作者 李宇航

合并分支 'develop' 到 'master'

Develop



查看合并请求 !387
@@ -125,6 +125,9 @@ class ProjectController extends BaseController @@ -125,6 +125,9 @@ class ProjectController extends BaseController
125 $query->whereIn('gl_project.type', [Project::TYPE_FOUR,Project::TYPE_SIX]); 125 $query->whereIn('gl_project.type', [Project::TYPE_FOUR,Project::TYPE_SIX]);
126 } 126 }
127 } 127 }
  128 + if(isset($this->map['uptime']) && is_array($this->map['uptime'])){
  129 + $query->whereBetween('gl_project.uptime', $this->map['uptime']);
  130 + }
128 return $query; 131 return $query;
129 } 132 }
130 133
@@ -153,6 +156,7 @@ class ProjectController extends BaseController @@ -153,6 +156,7 @@ class ProjectController extends BaseController
153 'gl_project.channel AS channel', 156 'gl_project.channel AS channel',
154 'gl_project.company AS company', 157 'gl_project.company AS company',
155 'gl_project.type AS type', 158 'gl_project.type AS type',
  159 + 'gl_project.is_upgrade AS is_upgrade',
156 'gl_project.created_at AS created_at', 160 'gl_project.created_at AS created_at',
157 'gl_project.cooperate_date AS cooperate_date', 161 'gl_project.cooperate_date AS cooperate_date',
158 'gl_project_online_check.id AS online_check_id', 162 'gl_project_online_check.id AS online_check_id',
@@ -38,8 +38,8 @@ class CustomModuleContentController extends BaseController @@ -38,8 +38,8 @@ class CustomModuleContentController extends BaseController
38 $data = $this->getAllCategoryName(); 38 $data = $this->getAllCategoryName();
39 foreach ($lists['list'] as $k=>$v){ 39 foreach ($lists['list'] as $k=>$v){
40 $v['url'] = $this->getUrl($v); 40 $v['url'] = $this->getUrl($v);
  41 + $v = $this->getHandleImageFile($v);
41 $v['category_name'] = $this->categoryName($v['category_id'],$data); 42 $v['category_name'] = $this->categoryName($v['category_id'],$data);
42 - $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']);  
43 $v['operator_name'] = (new User())->getName($v['operator_id']); 43 $v['operator_name'] = (new User())->getName($v['operator_id']);
44 $lists['list'][$k] = $v; 44 $lists['list'][$k] = $v;
45 } 45 }
@@ -48,6 +48,24 @@ class CustomModuleContentController extends BaseController @@ -48,6 +48,24 @@ class CustomModuleContentController extends BaseController
48 } 48 }
49 49
50 /** 50 /**
  51 + * @remark :获取时处理视频,图片,文件
  52 + * @name :getHandleImageFile
  53 + * @author :lyh
  54 + * @method :post
  55 + * @time :2024/1/31 15:48
  56 + */
  57 + public function getHandleImageFile($v){
  58 + if(!empty($v['image'])){
  59 + $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
  60 + }
  61 + if(!empty($v['video'])){
  62 + $v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
  63 + $v['video']['video_image'] = getImageUrl($v['video']['video_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
  64 + }
  65 + return $this->success($v);
  66 + }
  67 +
  68 + /**
51 * @remark :获取连接 69 * @remark :获取连接
52 * @name :getUrl 70 * @name :getUrl
53 * @author :lyh 71 * @author :lyh
@@ -141,6 +159,7 @@ class CustomModuleContentController extends BaseController @@ -141,6 +159,7 @@ class CustomModuleContentController extends BaseController
141 'id.required' => 'ID不能为空', 159 'id.required' => 'ID不能为空',
142 ]); 160 ]);
143 $info = $logic->getContentInfo(); 161 $info = $logic->getContentInfo();
  162 + $info = $this->getHandleImageFile($info);
144 $this->response('success',Code::SUCCESS,$info); 163 $this->response('success',Code::SUCCESS,$info);
145 } 164 }
146 165
@@ -135,7 +135,10 @@ class KeywordController extends BaseController @@ -135,7 +135,10 @@ class KeywordController extends BaseController
135 'title.array' => 'title为数组', 135 'title.array' => 'title为数组',
136 'title.max' => '批量操作不能超过1000条数据' 136 'title.max' => '批量操作不能超过1000条数据'
137 ]); 137 ]);
138 - $logic->batchAdd(); 138 + $rs = $logic->batchAdd();
  139 + if($rs === false){
  140 + $this->response('创建任务添加关键词任务失败,请稍后重试!',Code::SYSTEM_ERROR);
  141 + }
139 $this->response('关键词后台异步添加中,请稍后刷新查看!'); 142 $this->response('关键词后台异步添加中,请稍后刷新查看!');
140 } 143 }
141 144
@@ -20,10 +20,12 @@ use App\Models\Product\Product; @@ -20,10 +20,12 @@ use App\Models\Product\Product;
20 use App\Models\Template\Setting; 20 use App\Models\Template\Setting;
21 use App\Models\Template\BTemplate; 21 use App\Models\Template\BTemplate;
22 use App\Models\User\User; 22 use App\Models\User\User;
  23 +use App\Models\WebSetting\SettingNum;
23 use App\Rules\Ids; 24 use App\Rules\Ids;
24 use Illuminate\Http\Request; 25 use Illuminate\Http\Request;
25 use Illuminate\Support\Facades\Cache; 26 use Illuminate\Support\Facades\Cache;
26 use Illuminate\Support\Facades\DB; 27 use Illuminate\Support\Facades\DB;
  28 +use Illuminate\Support\Facades\Log;
27 29
28 /** 30 /**
29 * Class ProductController 31 * Class ProductController
@@ -92,11 +94,12 @@ class ProductController extends BaseController @@ -92,11 +94,12 @@ class ProductController extends BaseController
92 $v['icon'][$icon_k] = $icon_v; 94 $v['icon'][$icon_k] = $icon_v;
93 } 95 }
94 } 96 }
95 - if(!empty($v['video']) && !empty($v['video']['url'])){  
96 - $v['video']['url'] = getImageUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']); 97 + if(!empty($v['video'])){
  98 + $v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
  99 + $v['video']['video_image'] = getImageUrl($v['video']['video_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
97 } 100 }
98 if(!empty($v['files']) && !empty($v['files']['url'])){ 101 if(!empty($v['files']) && !empty($v['files']['url'])){
99 - $v['files']['url'] = getImageUrl($v['files']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']); 102 + $v['files']['url'] = getFileUrl($v['files']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
100 } 103 }
101 return $this->success($v); 104 return $this->success($v);
102 } 105 }
@@ -468,4 +471,54 @@ class ProductController extends BaseController @@ -468,4 +471,54 @@ class ProductController extends BaseController
468 $logic->setAllSort(); 471 $logic->setAllSort();
469 $this->response('success'); 472 $this->response('success');
470 } 473 }
  474 +
  475 + /**
  476 + * @remark :设置产品排序
  477 + * @name :setProductSort
  478 + * @author :lyh
  479 + * @method :post
  480 + * @time :2024/1/31 10:14
  481 + */
  482 + public function setProductSort(){
  483 + $setNumModel = new SettingNum();
  484 + try {
  485 + if(isset($this->param['id']) && !empty($this->param['id'])){
  486 + //执行编辑
  487 + $param = [
  488 + 'data'=>json_encode($this->param['data']),
  489 + ];
  490 + $setNumModel->edit($param,['id'=>$this->param['id']]);
  491 + }else{
  492 + //执行新增
  493 + $param = [
  494 + 'type'=>$setNumModel::TYPE_PRODUCT_SORT,
  495 + 'project_id'=>$this->user['project_id'],
  496 + 'data'=>json_encode($this->param['data']),
  497 + ];
  498 + $setNumModel->add($param);
  499 + }
  500 + }catch (\Exception $e){
  501 + Log::info('error file: ' . __CLASS__ . __FUNCTION__ . $e->getMessage());
  502 + $this->response('设置排序失败,请稍后重试',Code::SYSTEM_ERROR);
  503 + }
  504 + $this->response('success');
  505 + }
  506 +
  507 + /**
  508 + * @remark :获取产品排序
  509 + * @name :getProductSort
  510 + * @author :lyh
  511 + * @method :post
  512 + * @time :2024/1/31 10:24
  513 + */
  514 + public function getProductSort(){
  515 + $setNumModel = new SettingNum();
  516 + $info = $setNumModel->read(['type'=>$setNumModel::TYPE_PRODUCT_SORT]);
  517 + if($info === false){
  518 + $info = [];
  519 + }else{
  520 + $info['data'] = json_decode($info['data']);
  521 + }
  522 + $this->response('success',Code::SUCCESS,$info);
  523 + }
471 } 524 }
@@ -55,7 +55,7 @@ class OnlineCheckLogic extends BaseLogic @@ -55,7 +55,7 @@ class OnlineCheckLogic extends BaseLogic
55 $param['type'] = $this->param['project_type']; 55 $param['type'] = $this->param['project_type'];
56 } 56 }
57 if(isset($param)){ 57 if(isset($param)){
58 - $projectModel->edit(['type'=>$this->param['project_type']],['id'=>$this->param['id']]); 58 + $projectModel->edit($param,['id'=>$this->param['id']]);
59 } 59 }
60 } 60 }
61 $data = [ 61 $data = [
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 9
10 namespace App\Http\Logic\Bside\CustomModule; 10 namespace App\Http\Logic\Bside\CustomModule;
11 11
  12 +use App\Helper\Arr;
12 use App\Http\Logic\Bside\BaseLogic; 13 use App\Http\Logic\Bside\BaseLogic;
13 use App\Models\CustomModule\CustomModuleCategory; 14 use App\Models\CustomModule\CustomModuleCategory;
14 use App\Models\CustomModule\CustomModuleContent; 15 use App\Models\CustomModule\CustomModuleContent;
@@ -39,7 +40,6 @@ class CustomModuleContentLogic extends BaseLogic @@ -39,7 +40,6 @@ class CustomModuleContentLogic extends BaseLogic
39 if($info === false){ 40 if($info === false){
40 $this->fail('当前数据不存在或已被删除'); 41 $this->fail('当前数据不存在或已被删除');
41 } 42 }
42 - $info['image'] = getImageUrl($info['image'],$this->user['storage_type'],$this->user['project_location']);  
43 $info['extend'] = $this->getExtendInfo($info['module_id'],$info['id']); 43 $info['extend'] = $this->getExtendInfo($info['module_id'],$info['id']);
44 return $this->success($info); 44 return $this->success($info);
45 } 45 }
@@ -217,6 +217,11 @@ class CustomModuleContentLogic extends BaseLogic @@ -217,6 +217,11 @@ class CustomModuleContentLogic extends BaseLogic
217 if(isset($param['image']) && !empty($param['image'])){ 217 if(isset($param['image']) && !empty($param['image'])){
218 $param['image'] = str_replace_url($param['image']); 218 $param['image'] = str_replace_url($param['image']);
219 } 219 }
  220 + if(isset($param['video'])){
  221 + $param['video']['url'] = str_replace_url($param['video']['url']);
  222 + $param['video']['video_image'] = str_replace_url($param['video']['video_image']);
  223 + $param['video'] = Arr::a2s($param['video'] ?? []);
  224 + }
220 return $this->success($param); 225 return $this->success($param);
221 } 226 }
222 227
@@ -145,10 +145,10 @@ class KeywordLogic extends BaseLogic @@ -145,10 +145,10 @@ class KeywordLogic extends BaseLogic
145 $this->model->insertGetId($param); 145 $this->model->insertGetId($param);
146 } 146 }
147 } 147 }
148 - NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD, ['project_id' => $this->user['project_id']]);  
149 }catch (\Exception $e){ 148 }catch (\Exception $e){
150 - $this->fail('创建任务添加关键词任务失败,请稍后重试!'); 149 + return false;
151 } 150 }
  151 + NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD, ['project_id' => $this->user['project_id']]);
152 return $this->success(); 152 return $this->success();
153 } 153 }
154 154
@@ -287,6 +287,7 @@ class ProductLogic extends BaseLogic @@ -287,6 +287,7 @@ class ProductLogic extends BaseLogic
287 } 287 }
288 if(isset($param['video'])){ 288 if(isset($param['video'])){
289 $param['video']['url'] = str_replace_url($param['video']['url']); 289 $param['video']['url'] = str_replace_url($param['video']['url']);
  290 + $param['video']['video_image'] = str_replace_url($param['video']['video_image']);
290 $param['video'] = Arr::a2s($param['video'] ?? []); 291 $param['video'] = Arr::a2s($param['video'] ?? []);
291 } 292 }
292 if(isset($param['keyword_id']) && !empty($param['keyword_id'])){ 293 if(isset($param['keyword_id']) && !empty($param['keyword_id'])){
@@ -20,6 +20,8 @@ use App\Models\Base; @@ -20,6 +20,8 @@ use App\Models\Base;
20 */ 20 */
21 class SettingNum extends Base 21 class SettingNum extends Base
22 { 22 {
  23 + const TYPE_PRODUCT_SORT = 10;//c端显示排序
  24 +
23 protected $table = 'gl_setting_num'; 25 protected $table = 'gl_setting_num';
24 //连接数据库 26 //连接数据库
25 protected $connection = 'custom_mysql'; 27 protected $connection = 'custom_mysql';
@@ -223,6 +223,8 @@ Route::middleware(['bloginauth'])->group(function () { @@ -223,6 +223,8 @@ Route::middleware(['bloginauth'])->group(function () {
223 Route::post('/editList', [\App\Http\Controllers\Bside\Product\ProductController::class, 'editList'])->name('product_editList'); 223 Route::post('/editList', [\App\Http\Controllers\Bside\Product\ProductController::class, 'editList'])->name('product_editList');
224 Route::post('/sort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'sort'])->name('product_sort'); 224 Route::post('/sort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'sort'])->name('product_sort');
225 Route::post('/allSort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'allSort'])->name('product_allSort'); 225 Route::post('/allSort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'allSort'])->name('product_allSort');
  226 + Route::post('/setProductSort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'setProductSort'])->name('product_setProductSort');
  227 + Route::post('/getProductSort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getProductSort'])->name('product_getProductSort');
226 Route::any('/delete', [\App\Http\Controllers\Bside\Product\ProductController::class, 'delete'])->name('product_delete'); 228 Route::any('/delete', [\App\Http\Controllers\Bside\Product\ProductController::class, 'delete'])->name('product_delete');
227 Route::any('/statusNum', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getStatusNumber'])->name('product_statusNum'); 229 Route::any('/statusNum', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getStatusNumber'])->name('product_statusNum');
228 Route::any('/copyProduct', [\App\Http\Controllers\Bside\Product\ProductController::class, 'copyProduct'])->name('product_copyProduct'); 230 Route::any('/copyProduct', [\App\Http\Controllers\Bside\Product\ProductController::class, 'copyProduct'])->name('product_copyProduct');