|
...
|
...
|
@@ -27,6 +27,13 @@ use Illuminate\Support\Facades\DB; |
|
|
|
class ProductController extends BaseController
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :列表
|
|
|
|
* @name :index
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/28 16:30
|
|
|
|
*/
|
|
|
|
public function index(Product $product)
|
|
|
|
{
|
|
|
|
$this->order = 'sort';
|
|
...
|
...
|
@@ -51,24 +58,6 @@ 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
|
|
...
|
...
|
@@ -99,6 +88,25 @@ class ProductController extends BaseController |
|
|
|
$v['url'] = $this->user['domain'].$v['route'];
|
|
|
|
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 :保存产品数据
|
...
|
...
|
|