|
...
|
...
|
@@ -20,10 +20,12 @@ 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;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class ProductController
|
|
...
|
...
|
@@ -92,11 +94,12 @@ class ProductController extends BaseController |
|
|
|
$v['icon'][$icon_k] = $icon_v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!empty($v['video']) && !empty($v['video']['url'])){
|
|
|
|
$v['video']['url'] = getImageUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
|
|
|
|
if(!empty($v['video'])){
|
|
|
|
$v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
|
|
|
|
$v['video']['video_image'] = getImageUrl($v['video']['video_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
|
|
|
|
}
|
|
|
|
if(!empty($v['files']) && !empty($v['files']['url'])){
|
|
|
|
$v['files']['url'] = getImageUrl($v['files']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
|
|
|
|
$v['files']['url'] = getFileUrl($v['files']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
|
|
|
|
}
|
|
|
|
return $this->success($v);
|
|
|
|
}
|
|
...
|
...
|
@@ -468,4 +471,54 @@ 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){
|
|
|
|
Log::info('error file: ' . __CLASS__ . __FUNCTION__ . $e->getMessage());
|
|
|
|
$this->response('设置排序失败,请稍后重试',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
$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 = [];
|
|
|
|
}else{
|
|
|
|
$info['data'] = json_decode($info['data']);
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$info);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|