| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- /**
- * InventoryOrder.php
- * todo 文件描述
- * Created on 2024/3/26 10:25
- * @author: hankaige
- */
- namespace app\models;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- /**
- * This is the model class for table "{{%inventory_list}}".
- * @property integer $id
- * @property integer $sorting_id
- * @property integer $order_id
- * @property integer $is_delete
- * @property integer $created_at
- */
- class SortingOrder extends \yii\db\ActiveRecord
- {
- public static function tableName()
- {
- return "{{%sorting_order}}";
- }
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
- ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']
- ]
- ]
- ];
- }
- public function rules()
- {
- return [
- [['sorting_id','order_id'],'integer'],
- [['sorting_id','order_id'],'required'],
- ];
- }
- public function attributeLabels()
- {
- return [
- 'sorting_id'=>'分拣单ID','order_id'=>'订单ID'
- ];
- }
- public function getOrder()
- {
- return $this->hasOne(Order::className(),['id'=>'order_id'])->with(['orderDetail','user']);
- }
- }
|