TimestampBehavior::class, 'value' => time() ] ]; } public function rules() { return [ [['store_id', 'goods_id',], 'required', 'on' => self::whenSave()], [['store_id', 'goods_id', 'is_delete', 'created_at', 'updated_at', 'growth_cycle' ], 'integer', 'on' => self::whenSave()], [['desc', 'yield', 'varieties', ], 'string', 'max' => 255, 'on' => self::whenSave()], [['adopt_income', 'self_pick_date', 'self_pick_times'], 'string', 'on' => self::whenSave()], [['goods_id', 'store_id'], 'integer', 'on' => self::whenList()], ]; } public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'goods_id' => '商品id', 'desc' => '认养简介', 'yield' => '认养产量', 'varieties' => '认养品种', 'growth_cycle' => '生长周期', 'adopt_income' => '认养收获', 'self_pick_date' => '自采日期', 'self_pick_times' => '自采时间', 'is_delete' => 'Is Delete', 'created_at' => '创建时间', 'updated_at' => '更新时间', ]; } public static function whenSave () { return 'save'; } public static function whenList () { return 'list'; } }