|
...
|
...
|
@@ -2,10 +2,12 @@ |
|
|
|
|
|
|
|
namespace App\Http\Controllers\Bside\Product;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Helper\Arr;
|
|
|
|
use App\Http\Controllers\Bside\BaseController;
|
|
|
|
use App\Http\Logic\Bside\Product\DescribeLogic;
|
|
|
|
use App\Http\Requests\Bside\Product\DescribeRequest;
|
|
|
|
use App\Models\Product\Describe;
|
|
|
|
use App\Rules\Ids;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
...
|
...
|
@@ -18,15 +20,14 @@ use Illuminate\Http\Request; |
|
|
|
class DescribeController extends BaseController
|
|
|
|
{
|
|
|
|
|
|
|
|
public function index(DescribeLogic $logic)
|
|
|
|
public function index(Describe $describe)
|
|
|
|
{
|
|
|
|
$map = [];
|
|
|
|
if(!empty($this->param['search'])){
|
|
|
|
$map[] = ['title', 'like', "%{$this->param['search']}%"];
|
|
|
|
if(!empty($this->map['search'])){
|
|
|
|
$this->map['title'] = ['like',"%{$this->param['search']}%"];
|
|
|
|
unset($this->map['search']);
|
|
|
|
}
|
|
|
|
$sort = ['id' => 'desc'];
|
|
|
|
$data = $logic->getList($map, $sort, ['id', 'title', 'text', 'status', 'created_at'],$this->row);
|
|
|
|
return $this->success($data);
|
|
|
|
$data = $describe->lists($this->map,$this->page,$this->row, 'id', ['id', 'title', 'text', 'status', 'created_at']);
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function info(Request $request, DescribeLogic $logic){
|
|
...
|
...
|
@@ -39,10 +40,18 @@ class DescribeController extends BaseController |
|
|
|
return $this->success(Arr::twoKeepKeys($data, ['id', 'title', 'text', 'created_at']));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function save(DescribeRequest $request, DescribeLogic $logic)
|
|
|
|
/**
|
|
|
|
* @remark :baocun
|
|
|
|
* @name :save
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/10/17 10:36
|
|
|
|
*/
|
|
|
|
public function save(DescribeRequest $request,DescribeLogic $logic)
|
|
|
|
{
|
|
|
|
$data = $logic->save($this->param);
|
|
|
|
return $this->success($data);
|
|
|
|
$request->validated();
|
|
|
|
$data = $logic->describeSave();
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function delete(Request $request, DescribeLogic $logic)
|
...
|
...
|
|