| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace app\workerapi\validate\shops;
- use app\common\validate\BaseValidate;
- class ShopCartValidate extends BaseValidate
- {
- protected $rule = [
- 'shop_goods_id' => 'require',
- 'goods_specs_inventory_id' => 'require',
- 'number' => 'require|min:1',
- 'ids' => 'require|array',
- ];
- protected $field = [
- 'shop_goods_id' => '商品id',
- 'goods_specs_inventory_id' => '规格ID',
- 'number' => '数量',
- ];
- public function sceneAdd()
- {
- return $this->only(['shop_goods_id', 'goods_specs_inventory_id', 'number']);
- }
- /**
- * @notes 删除场景
- * @return ShopGoodsValidate
- * @author likeadmin
- * @date 2024/08/04 11:07
- */
- public function sceneDelete()
- {
- return $this->only(['ids']);
- }
- public function sceneEdit()
- {
- return $this->only(['id', 'number']);
- }
- }
|