|
...
|
...
|
@@ -182,6 +182,24 @@ class ProductController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :详情
|
|
|
|
* @name :info
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/21 18:12
|
|
|
|
*/
|
|
|
|
public function info(Product $product){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required'
|
|
|
|
],[
|
|
|
|
'id.required' => 'ID不能为空'
|
|
|
|
]);
|
|
|
|
$info = $product->read(['id'=>$this->param['id']]);
|
|
|
|
$info = $this->handleParam($info);
|
|
|
|
return $this->response('success',Code::SUCCESS,$info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :处理列表参数
|
|
|
|
* @name :handleParam
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -212,25 +230,6 @@ class ProductController extends BaseController |
|
|
|
return $v;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :详情
|
|
|
|
* @name :info
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/21 18:12
|
|
|
|
*/
|
|
|
|
public function info(Product $product){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required'
|
|
|
|
],[
|
|
|
|
'id.required' => 'ID不能为空'
|
|
|
|
]);
|
|
|
|
$info = $product->read(['id'=>$this->param['id']]);
|
|
|
|
$info = $this->handleParam($info);
|
|
|
|
return $this->response('success',Code::SUCCESS,$info);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存产品数据
|
...
|
...
|
|