Skip to content
关注公众号,获取新课通知

添加商品规格卡片属性


控制器 app/controller/admin/GoodsSkusCardValue.php

php
public function save(Request $request)
{
    $res = $this->M->save($request->param());
    return showSuccess($res);
}

验证器 app/validate/admin/GoodsSkusCardValue.php

php
// 验证规则
protected $rule = [ 	'goods_skus_card_id'=>'require|integer|>=:0|isExist:GoodsSkusCard,false',
     'name'=>'require|NotEmpty',
     'value'=>'NotEmpty',	
     'order'=>'require|integer|>:0',	
];

protected $scene = [
    ...
    'save'=>['name','value','order','goods_skus_card_id'],
];

路由 router/admin.php

php
Route::post('goods_skus_card_value','admin.GoodsSkusCardValue/save');