| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- /**
- * InventoryOrderGoods.php
- * todo 文件描述
- * Created on 2024/3/26 10:33
- * @author: hankaige
- */
- namespace app\models;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- /**
- * This is the model class for table "{{%sorting_list}}".
- * @property integer $id
- * @property integer $sorting_id
- * @property integer $goods_id
- * @property string $goods_name
- * @property string $attr
- * @property integer $num
- * @property integer $created_at
- * @property integer $updated_at
- * @property integer $is_delete
- */
- class SortingOrderGoods extends \yii\db\ActiveRecord
- {
- public static function tableName()
- {
- return "{{%sorting_order_goods}}";
- }
- 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',
- 'goods_id',
- 'num',
- ],
- 'integer'
- ],
- [
- [
- 'goods_name',
- 'attr'
- ],
- 'string'
- ],
- [
- [
- 'sorting_id',
- 'goods_id',
- 'num',
- 'goods_name',
- 'attr'
- ],
- 'required'
- ]
- ];
- }
- public function attributeLabels()
- {
- return [
- 'sorting_id' => '备货单ID',
- 'goods_id' => '商品ID',
- 'num' => '商品数量',
- 'goods_name' => '商品名称',
- 'attr' => '规格',
- ];
- }
- public function getGoods()
- {
- return $this->hasOne(Goods::className(),['id'=>'goods_id']);
- }
- }
|