|
...
|
...
|
@@ -20,6 +20,7 @@ use App\Models\Product\Product; |
|
|
|
use App\Models\Template\Setting;
|
|
|
|
use App\Models\Template\BTemplate;
|
|
|
|
use App\Models\User\User;
|
|
|
|
use App\Models\WebSetting\SettingNum;
|
|
|
|
use App\Rules\Ids;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
...
|
...
|
@@ -468,4 +469,51 @@ class ProductController extends BaseController |
|
|
|
$logic->setAllSort();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :设置产品排序
|
|
|
|
* @name :setProductSort
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/1/31 10:14
|
|
|
|
*/
|
|
|
|
public function setProductSort(){
|
|
|
|
$setNumModel = new SettingNum();
|
|
|
|
try {
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
//执行编辑
|
|
|
|
$param = [
|
|
|
|
'data'=>json_encode($this->param['data']),
|
|
|
|
];
|
|
|
|
$setNumModel->edit($param,['id'=>$this->param['id']]);
|
|
|
|
}else{
|
|
|
|
//执行新增
|
|
|
|
$param = [
|
|
|
|
'type'=>$setNumModel::TYPE_PRODUCT_SORT,
|
|
|
|
'project_id'=>$this->user['project_id'],
|
|
|
|
'data'=>json_encode($this->param['data']),
|
|
|
|
];
|
|
|
|
$setNumModel->add($param);
|
|
|
|
}
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
|
|
}
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取产品排序
|
|
|
|
* @name :getProductSort
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/1/31 10:24
|
|
|
|
*/
|
|
|
|
public function getProductSort(){
|
|
|
|
$setNumModel = new SettingNum();
|
|
|
|
$info = $setNumModel->read(['type'=>$setNumModel::TYPE_PRODUCT_SORT]);
|
|
|
|
if($info === false){
|
|
|
|
$info = [];
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$info);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|