TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'], ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'] ] ] ]; } /** * @inheritdoc */ public function rules() { return [ [['id', 'goods_id', 'virtual_sales', 'store_id', 'is_delete', 'activity_id', 'cat_id', 'use_attr'], 'integer'], [['attr'], 'string'], [['sale_num', 'pt_price'], 'number'], [['created_at', 'updated_at'], 'safe'] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => '', 'goods_id' => '商品id', 'attr' => '商品规格', 'virtual_sales' => '虚拟销量', 'pt_price' => '拼团价格', 'store_id' => 'Store ID', 'is_delete' => 'IS Delete', 'activity_id' => '活动id', 'created_at' => '', 'updated_at' => '', 'use_attr' => '是否使用规格', 'sale_num' => '售卖数量', 'cat_id' => '分类ID' ]; } }