作者 lyh

gx

@@ -182,6 +182,24 @@ class ProductController extends BaseController @@ -182,6 +182,24 @@ class ProductController extends BaseController
182 } 182 }
183 183
184 /** 184 /**
  185 + * @remark :详情
  186 + * @name :info
  187 + * @author :lyh
  188 + * @method :post
  189 + * @time :2023/8/21 18:12
  190 + */
  191 + public function info(Product $product){
  192 + $this->request->validate([
  193 + 'id'=>'required'
  194 + ],[
  195 + 'id.required' => 'ID不能为空'
  196 + ]);
  197 + $info = $product->read(['id'=>$this->param['id']]);
  198 + $info = $this->handleParam($info);
  199 + return $this->response('success',Code::SUCCESS,$info);
  200 + }
  201 +
  202 + /**
185 * @remark :处理列表参数 203 * @remark :处理列表参数
186 * @name :handleParam 204 * @name :handleParam
187 * @author :lyh 205 * @author :lyh
@@ -212,25 +230,6 @@ class ProductController extends BaseController @@ -212,25 +230,6 @@ class ProductController extends BaseController
212 return $v; 230 return $v;
213 } 231 }
214 232
215 - /**  
216 - * @remark :详情  
217 - * @name :info  
218 - * @author :lyh  
219 - * @method :post  
220 - * @time :2023/8/21 18:12  
221 - */  
222 - public function info(Product $product){  
223 - $this->request->validate([  
224 - 'id'=>'required'  
225 - ],[  
226 - 'id.required' => 'ID不能为空'  
227 - ]);  
228 - $info = $product->read(['id'=>$this->param['id']]);  
229 - $info = $this->handleParam($info);  
230 - return $this->response('success',Code::SUCCESS,$info);  
231 - }  
232 -  
233 -  
234 233
235 /** 234 /**
236 * @remark :保存产品数据 235 * @remark :保存产品数据