50], [['goods_sn', 'goods_attr'], 'string', 'max' => 60], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'id', 'goods_id' => '商品id', 'goods_code' => '商品条码', 'goods_sn' => '商品唯一货号', 'goods_attr' => '属性匹配', 'sold_count' => '已售数量', 'stock' => '库存', 'market_price' => '市场价', 'price' => '销售价', 'model_id' => '模型id', 'is_sale' => '该商品是否开放销售,1为是,0为否', 'sort_order' => '排序', 'is_delete' => '是否删除,1为已删除', 'created_at' => '创建时间', 'updated_at' => '更新时间', ]; } /** * @author linyao * @email 602604991@qq.com * @created Nov 8, 2019 * * 行为存储创建时间和更新时间 */ public function behaviors() { return [ [ 'class' => TimestampBehavior::className(), 'createdAtAttribute' => 'created_at', 'updatedAtAttribute' => 'updated_at', 'value' => function() { return time(); }, ], ]; } }