120], [['sn'], 'string', 'max' => 60], [['code'], 'string', 'max' => 50], [['unit'], 'string', 'max' => 16], [['brief'], 'string', 'max' => 255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'id', 'pid' => '父级id', 'cat_id' => '后台商品类别id', 'brand_id' => '品牌id', 'shop_cat_id' => '前端商品类别id', 'name' => '商品名称', 'sn' => '商品唯一货号', 'code' => '商品货码', 'supplier_id' => '供应商id', 'weight' => '重量', 'length' => '长度', 'width' => '宽度', 'height' => '高度', 'diameter' => '直径', 'unit' => '单位', 'sold_count' => '已售数量', 'limit_count' => '限购数量', 'stock' => '库存', 'stock_warn' => '库存警告', 'market_price' => '市场价', 'price' => '销售价', 'brief' => '简介', 'description' => '详细介绍', 'image' => '图片id', 'model_id' => '模型id', 'is_sale' => '该商品是否开放销售,1为是,0为否', 'sort_order' => '排序', 'bouns_points' => '奖励积分', 'experience_points' => '经验值', 'is_delete' => '是否删除,1为已删除', 'express_template' => '配送详情id', '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(); }, ], ]; } }