| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\plugins\product_traceability\models;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- /**
- *
- * Class ProductBatch
- * @package app\plugins\product_traceability\models
- * @property integer $id
- * @property integer $store_id
- * @property string $batch_number
- * @property string $batch_name
- * @property integer $state
- * @property integer $product_id
- * @property integer $goods_id
- * @property integer $is_delete
- * @property string $created_at
- * @property string $updated_at
- */
- class ProductBatch extends ActiveRecord
- {
- public function behaviors()
- {
- return [
- [
- // 自动更新创建和更新时间
- 'class' => TimestampBehavior::class,
- 'value' => time()
- ]
- ];
- }
- public static function tableName()
- {
- return '{{%product_batch}}';
- }
- public function rules()
- {
- return [
- [['store_id', 'batch_number', 'batch_name'], 'required'],
- [['store_id', 'created_at', 'updated_at', 'is_delete', 'state', 'product_id', 'goods_id'], 'integer'],
- [['batch_number', 'batch_name'], 'string', 'max' => 255],
- ];
- }
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'store_id' => '商城id',
- 'batch_number' => '批次编号',
- 'batch_name' => '批次名称',
- 'created_at' => '创建时间',
- 'updated_at' => '更新时间',
- 'is_delete' => 'Is Delete',
- 'state' => '是否绑定 0-未绑定 1-已绑定',
- 'product_id' => '产品id',
- 'goods_id' => '商品id',
- ];
- }
- }
|