Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate
正在显示
21 个修改的文件
包含
467 行增加
和
87 行删除
| @@ -9,20 +9,13 @@ namespace App\Console\Commands\KeywordInVideo; | @@ -9,20 +9,13 @@ namespace App\Console\Commands\KeywordInVideo; | ||
| 9 | 9 | ||
| 10 | use App\Console\Commands\Model; | 10 | use App\Console\Commands\Model; |
| 11 | use App\Console\Commands\TaskSub; | 11 | use App\Console\Commands\TaskSub; |
| 12 | -use App\Enums\Common\Code; | ||
| 13 | use App\Models\Com\KeywordVideoTask; | 12 | use App\Models\Com\KeywordVideoTask; |
| 14 | use App\Models\Com\KeywordVideoTaskLog; | 13 | use App\Models\Com\KeywordVideoTaskLog; |
| 15 | use App\Models\Domain\DomainInfo; | 14 | use App\Models\Domain\DomainInfo; |
| 16 | use App\Models\Product\Keyword; | 15 | use App\Models\Product\Keyword; |
| 17 | use App\Models\Product\Product; | 16 | use App\Models\Product\Product; |
| 18 | -use App\Models\RouteMap\RouteMap; | ||
| 19 | -use App\Models\Template\BSettingTemplate; | ||
| 20 | -use App\Models\Template\BTemplateCommon; | ||
| 21 | -use App\Models\Template\Setting; | ||
| 22 | use App\Services\ProjectServer; | 17 | use App\Services\ProjectServer; |
| 23 | use Illuminate\Console\Command; | 18 | use Illuminate\Console\Command; |
| 24 | -use Illuminate\Support\Facades\Cache; | ||
| 25 | -use Illuminate\Support\Facades\DB; | ||
| 26 | use Illuminate\Support\Facades\Http; | 19 | use Illuminate\Support\Facades\Http; |
| 27 | use Illuminate\Support\Facades\Log; | 20 | use Illuminate\Support\Facades\Log; |
| 28 | 21 |
| @@ -2,10 +2,14 @@ | @@ -2,10 +2,14 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Http\Controllers\Api; | 3 | namespace App\Http\Controllers\Api; |
| 4 | 4 | ||
| 5 | +use App\Enums\Common\Code; | ||
| 5 | use App\Exceptions\InquiryFilterException; | 6 | use App\Exceptions\InquiryFilterException; |
| 6 | use App\Models\SyncSubmitTask\SyncSubmitTask; | 7 | use App\Models\SyncSubmitTask\SyncSubmitTask; |
| 8 | +use App\Models\Visit\Visit; | ||
| 7 | use App\Services\CosService; | 9 | use App\Services\CosService; |
| 10 | +use App\Services\ProjectServer; | ||
| 8 | use Illuminate\Http\Request; | 11 | use Illuminate\Http\Request; |
| 12 | +use Illuminate\Support\Facades\DB; | ||
| 9 | 13 | ||
| 10 | /** | 14 | /** |
| 11 | * Class InquiryController | 15 | * Class InquiryController |
| @@ -51,4 +55,39 @@ class InquiryController extends BaseController | @@ -51,4 +55,39 @@ class InquiryController extends BaseController | ||
| 51 | } | 55 | } |
| 52 | return $this->success(); | 56 | return $this->success(); |
| 53 | } | 57 | } |
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * @remark :修改 | ||
| 61 | + * @name :editInquiryStatus | ||
| 62 | + * @author :lyh | ||
| 63 | + * @method :post | ||
| 64 | + * @time :2024/3/22 15:41 | ||
| 65 | + */ | ||
| 66 | + public function editInquiryStatus(){ | ||
| 67 | + $this->request->validate([ | ||
| 68 | + 'project_id'=>'required', | ||
| 69 | + 'ip'=>'required', | ||
| 70 | + 'updated_date'=>'required', | ||
| 71 | + ],[ | ||
| 72 | + 'project_id.required' => 'project_id不能为空', | ||
| 73 | + 'ip.required' => 'ip不能为空', | ||
| 74 | + 'updated_date.required' => '日期不能为空', | ||
| 75 | + ]); | ||
| 76 | + ProjectServer::useProject($this->param['project_id']); | ||
| 77 | + $customerVisitModel = new Visit(); | ||
| 78 | + $info = $customerVisitModel->read([ | ||
| 79 | + 'ip'=>$this->param['ip'], | ||
| 80 | + 'updated_date'=>$this->param['updated_date'] | ||
| 81 | + ]); | ||
| 82 | + if($info === false){ | ||
| 83 | + $this->response('当前记录不存在',Code::SYSTEM_ERROR); | ||
| 84 | + } | ||
| 85 | + try { | ||
| 86 | + $customerVisitModel->edit(['is_inquiry'=>1],['id'=>$info['id']]); | ||
| 87 | + }catch (\Exception $e){ | ||
| 88 | + $this->response('操作失败',Code::SYSTEM_ERROR); | ||
| 89 | + } | ||
| 90 | + DB::disconnect('custom_mysql'); | ||
| 91 | + $this->response('success'); | ||
| 92 | + } | ||
| 54 | } | 93 | } |
| @@ -160,4 +160,95 @@ class ProductController extends BaseController | @@ -160,4 +160,95 @@ class ProductController extends BaseController | ||
| 160 | } | 160 | } |
| 161 | return $category_id; | 161 | return $category_id; |
| 162 | } | 162 | } |
| 163 | + | ||
| 164 | + /** | ||
| 165 | + * @param Request $request | ||
| 166 | + * @author zbj | ||
| 167 | + * @date 2024/1/22 | ||
| 168 | + */ | ||
| 169 | + protected function searchProduct(Request $request) | ||
| 170 | + { | ||
| 171 | + $project_id = $request->input('project_id'); | ||
| 172 | + $limit = $request->input('limit') ?: 5; | ||
| 173 | + $text = $request->input('text'); | ||
| 174 | + $key = $request->input('key') ?: 'title'; | ||
| 175 | + $key_limit = $request->input('key_limit') ?: 15; | ||
| 176 | + | ||
| 177 | + $project = ProjectServer::useProject($project_id); | ||
| 178 | + if (!$project) { | ||
| 179 | + $this->response('项目不存在', Code::SYSTEM_ERROR); | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + //匹配产品 | ||
| 183 | + $products = Product::with('category') | ||
| 184 | + ->where("title", 'like', $text . '%') | ||
| 185 | + ->where("status", 1) | ||
| 186 | + ->orderBy("id", "DESC") | ||
| 187 | + ->limit($limit) | ||
| 188 | + ->select('title', 'thumb', 'id', 'route') | ||
| 189 | + ->get() | ||
| 190 | + ->toArray(); | ||
| 191 | + | ||
| 192 | + //对应分类 | ||
| 193 | + $categories = []; | ||
| 194 | + foreach ($products as &$product) { | ||
| 195 | + foreach ($product['category'] as $category) { | ||
| 196 | + $categories[$category['route']] = [ | ||
| 197 | + 'title' => $category['title'], | ||
| 198 | + 'route' => '/' . $category['route'] . '/', | ||
| 199 | + ]; | ||
| 200 | + } | ||
| 201 | + unset($product['id']); | ||
| 202 | + unset($product['category']); | ||
| 203 | + | ||
| 204 | + if(!empty($product['thumb']) && !empty($product['thumb']['url'])){ | ||
| 205 | + $product['thumb'] = getImageUrl($product['thumb']['url'],$project['storage_type'] ?? 0,$project['project_location']); | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + $product['route'] = '/' . $product['route'] . '/'; | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + $data = [ | ||
| 212 | + 'products' => $products, | ||
| 213 | + 'categories' => array_values($categories), | ||
| 214 | + 'suggestions' => $this->searchSuggestion($text, $key, $key_limit) | ||
| 215 | + ]; | ||
| 216 | + | ||
| 217 | + $this->response('success', Code::SUCCESS, $data); | ||
| 218 | + | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | + protected function searchSuggestion($text, $key, $key_limit): array | ||
| 222 | + { | ||
| 223 | + $model = new Product(); | ||
| 224 | + $columns = $model->getConnection()->getSchemaBuilder()->getColumnListing($model->getTable()); | ||
| 225 | + | ||
| 226 | + //产品字段 | ||
| 227 | + if (in_array($key, $columns)) { | ||
| 228 | + //匹配产品 | ||
| 229 | + $suggestions = Product::where("status", 1) | ||
| 230 | + ->where($key, 'like', $text . '%') | ||
| 231 | + ->orderBy("id", "DESC") | ||
| 232 | + ->limit($key_limit) | ||
| 233 | + ->select($key .' as title', 'route') | ||
| 234 | + ->get() | ||
| 235 | + ->toArray(); | ||
| 236 | + } else { | ||
| 237 | + //扩展字段 | ||
| 238 | + $suggestions = Product::leftJoin('gl_product_extend_info as pei', 'gl_product.id', '=', 'pei.product_id') | ||
| 239 | + ->where('pei.values', 'like', $text . '%') | ||
| 240 | + ->where("gl_product.status", 1) | ||
| 241 | + ->orderBy("gl_product.id", "DESC") | ||
| 242 | + ->limit($key_limit) | ||
| 243 | + ->select('pei.values','gl_product.route') | ||
| 244 | + ->get() | ||
| 245 | + ->toArray(); | ||
| 246 | + } | ||
| 247 | + | ||
| 248 | + foreach ($suggestions as &$suggestion){ | ||
| 249 | + $suggestion['route'] = '/' . $suggestion['route'] . '/'; | ||
| 250 | + } | ||
| 251 | + | ||
| 252 | + return $suggestions; | ||
| 253 | + } | ||
| 163 | } | 254 | } |
| @@ -142,8 +142,8 @@ class ProductController extends BaseController | @@ -142,8 +142,8 @@ class ProductController extends BaseController | ||
| 142 | if(isset($this->map['status'])){ | 142 | if(isset($this->map['status'])){ |
| 143 | $query = $query->where('status',$this->map['status']); | 143 | $query = $query->where('status',$this->map['status']); |
| 144 | } | 144 | } |
| 145 | - if(!empty($this->map['created_at']) && !empty($this->map['created_at'])){ | ||
| 146 | - $query->whereBetween('created_at', $this->map['created_at'][1]); | 145 | + if(!empty($this->param['start_at']) && !empty($this->param['end_at'])){ |
| 146 | + $query->where('created_at', '>=' ,$this->param['start_at'].' 00:00:00')->where('created_at', '<=' ,$this->param['end_at'].' 59:59:59'); | ||
| 147 | } | 147 | } |
| 148 | return $query; | 148 | return $query; |
| 149 | } | 149 | } |
| @@ -34,7 +34,7 @@ class TranslateLogic extends BaseLogic | @@ -34,7 +34,7 @@ class TranslateLogic extends BaseLogic | ||
| 34 | if($this->param['url'] == 'All'){ | 34 | if($this->param['url'] == 'All'){ |
| 35 | $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); | 35 | $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); |
| 36 | if(!empty($info) && !empty($info['data'])){ | 36 | if(!empty($info) && !empty($info['data'])){ |
| 37 | - $translateInfo = json_decode($info['data'],true); | 37 | + $translateInfo = json_decode($info['data'],JSON_UNESCAPED_UNICODE); |
| 38 | foreach ($translateInfo as $k => $v){ | 38 | foreach ($translateInfo as $k => $v){ |
| 39 | $data[] = [$k=>$v]; | 39 | $data[] = [$k=>$v]; |
| 40 | } | 40 | } |
| @@ -48,7 +48,7 @@ class TranslateLogic extends BaseLogic | @@ -48,7 +48,7 @@ class TranslateLogic extends BaseLogic | ||
| 48 | // 原始校对内容 | 48 | // 原始校对内容 |
| 49 | $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); | 49 | $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); |
| 50 | if($info !== false){ | 50 | if($info !== false){ |
| 51 | - $data_read = json_decode($info['data'],true); | 51 | + $data_read = json_decode($info['data'],JSON_UNESCAPED_UNICODE); |
| 52 | foreach ($data_read as $k => $v){ | 52 | foreach ($data_read as $k => $v){ |
| 53 | $data[] = [$k => $v]; | 53 | $data[] = [$k => $v]; |
| 54 | } | 54 | } |
| @@ -130,7 +130,7 @@ class TranslateLogic extends BaseLogic | @@ -130,7 +130,7 @@ class TranslateLogic extends BaseLogic | ||
| 130 | $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); | 130 | $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); |
| 131 | $data = []; | 131 | $data = []; |
| 132 | if(!empty($info) && !empty($info['data'])){ | 132 | if(!empty($info) && !empty($info['data'])){ |
| 133 | - $translateInfo = json_decode($info['data'],true); | 133 | + $translateInfo = json_decode($info['data'],JSON_UNESCAPED_UNICODE); |
| 134 | foreach ($translateInfo as $k => $v){ | 134 | foreach ($translateInfo as $k => $v){ |
| 135 | $data[] = [$k=>$v]; | 135 | $data[] = [$k=>$v]; |
| 136 | } | 136 | } |
| @@ -151,7 +151,7 @@ class TranslateLogic extends BaseLogic | @@ -151,7 +151,7 @@ class TranslateLogic extends BaseLogic | ||
| 151 | } | 151 | } |
| 152 | $new_list = $this->getUrlImageRead($url); | 152 | $new_list = $this->getUrlImageRead($url); |
| 153 | $old_list = []; | 153 | $old_list = []; |
| 154 | - $data_read = json_decode($info['data'],true); | 154 | + $data_read = json_decode($info['data'],JSON_UNESCAPED_UNICODE); |
| 155 | foreach ($data_read as $k=>$v){ | 155 | foreach ($data_read as $k=>$v){ |
| 156 | $old_list[] = $k; | 156 | $old_list[] = $k; |
| 157 | $data[] = [ | 157 | $data[] = [ |
| @@ -282,10 +282,10 @@ class TranslateLogic extends BaseLogic | @@ -282,10 +282,10 @@ class TranslateLogic extends BaseLogic | ||
| 282 | 'language_id'=>$this->param['language_id'], | 282 | 'language_id'=>$this->param['language_id'], |
| 283 | 'alias'=>$this->param['alias'], | 283 | 'alias'=>$this->param['alias'], |
| 284 | ]; | 284 | ]; |
| 285 | - $param['data'] = json_encode($data,true); | 285 | + $param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE); |
| 286 | $this->model->add($param); | 286 | $this->model->add($param); |
| 287 | }else{ | 287 | }else{ |
| 288 | - $data = json_encode($data,true); | 288 | + $data = json_encode($data,JSON_UNESCAPED_UNICODE); |
| 289 | $this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); | 289 | $this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); |
| 290 | } | 290 | } |
| 291 | }catch (\Exception $e){ | 291 | }catch (\Exception $e){ |
| @@ -17,20 +17,4 @@ class CustomModule extends Base | @@ -17,20 +17,4 @@ class CustomModule extends Base | ||
| 17 | protected $table = 'gl_custom_module'; | 17 | protected $table = 'gl_custom_module'; |
| 18 | //连接数据库 | 18 | //连接数据库 |
| 19 | protected $connection = 'custom_mysql'; | 19 | protected $connection = 'custom_mysql'; |
| 20 | - /** | ||
| 21 | - * 根据模块查找自定义模块分类数据 | ||
| 22 | - */ | ||
| 23 | - public static function getModuleCategory($projectId,$modules) | ||
| 24 | - { | ||
| 25 | - $moduleCategoryInfo = null; | ||
| 26 | - if (isset($modules->category_id) && !empty($modules->category_id) && $modules->category_id != ",,"){ | ||
| 27 | - $cateArr = explode(",",$modules->category_id); | ||
| 28 | - $cateArr = array_filter($cateArr); | ||
| 29 | - if (!empty($cateArr)){ | ||
| 30 | - $cateId = (int)array_shift($cateArr); | ||
| 31 | - $moduleCategoryInfo = CustomModuleCategory::getModuleCategoryAndExtendById($projectId,$cateId); | ||
| 32 | - } | ||
| 33 | - } | ||
| 34 | - return $moduleCategoryInfo; | ||
| 35 | - } | ||
| 36 | } | 20 | } |
| @@ -11,6 +11,9 @@ namespace App\Models\CustomModule; | @@ -11,6 +11,9 @@ namespace App\Models\CustomModule; | ||
| 11 | 11 | ||
| 12 | use App\Helper\Arr; | 12 | use App\Helper\Arr; |
| 13 | use App\Models\Base; | 13 | use App\Models\Base; |
| 14 | +use App\Models\Module\CustomModule; | ||
| 15 | +use App\Models\Module\ModuleCategory; | ||
| 16 | +use App\Services\Html\PageService; | ||
| 14 | 17 | ||
| 15 | class CustomModuleContent extends Base | 18 | class CustomModuleContent extends Base |
| 16 | { | 19 | { |
| @@ -18,8 +21,9 @@ class CustomModuleContent extends Base | @@ -18,8 +21,9 @@ class CustomModuleContent extends Base | ||
| 18 | //连接数据库 | 21 | //连接数据库 |
| 19 | protected $connection = 'custom_mysql'; | 22 | protected $connection = 'custom_mysql'; |
| 20 | 23 | ||
| 21 | - public function getCategoryIdAttribute($value){ | ||
| 22 | - return explode(',',trim($value,',')); | 24 | + public function getCategoryIdAttribute($value) |
| 25 | + { | ||
| 26 | + return explode(',', trim($value, ',')); | ||
| 23 | } | 27 | } |
| 24 | 28 | ||
| 25 | /** | 29 | /** |
| @@ -29,10 +33,114 @@ class CustomModuleContent extends Base | @@ -29,10 +33,114 @@ class CustomModuleContent extends Base | ||
| 29 | * @method :post | 33 | * @method :post |
| 30 | * @time :2024/1/23 14:31 | 34 | * @time :2024/1/23 14:31 |
| 31 | */ | 35 | */ |
| 32 | - public function getVideoAttribute($value){ | ||
| 33 | - if(!empty($value)){ | 36 | + public function getVideoAttribute($value) |
| 37 | + { | ||
| 38 | + if (!empty($value)) { | ||
| 34 | $value = Arr::s2a($value); | 39 | $value = Arr::s2a($value); |
| 35 | } | 40 | } |
| 36 | return $value; | 41 | return $value; |
| 37 | } | 42 | } |
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * 根据路由获取模块信息 | ||
| 46 | + */ | ||
| 47 | + public static function getModuleAndExtendById($projectId, $id) | ||
| 48 | + { | ||
| 49 | + return self::with("getExtend")->where("project_id", $projectId)->where("id", $id)->where("status", 0)->first(); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 关联模块信息 | ||
| 54 | + */ | ||
| 55 | + public function getExtend(): \Illuminate\Database\Eloquent\Relations\HasOne | ||
| 56 | + { | ||
| 57 | + return $this->hasOne(CustomModule::class, 'id', 'module_id'); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * module数据处理 | ||
| 62 | + */ | ||
| 63 | + public static function modulesListDataHandle($moduleCategoryInfo, $modules): array | ||
| 64 | + { | ||
| 65 | + $newT = []; | ||
| 66 | + $pageService = new PageService(); | ||
| 67 | + if (!empty($modules)) { | ||
| 68 | + foreach ($modules as $key => $item) { | ||
| 69 | + if (!empty($item->remark)) { | ||
| 70 | + $remark = $item->remark; | ||
| 71 | + } else { | ||
| 72 | + $text = strip_tags($item->content); | ||
| 73 | + $remark = strlen($text) > 260 ? substr($text, 0, 260) . '...' : $text; | ||
| 74 | + } | ||
| 75 | + $newT[$key]["id"] = $item->id; | ||
| 76 | + if (!empty($item->category_id)) { | ||
| 77 | + $categoryIdArr = explode(",", $item->category_id); | ||
| 78 | + if (!empty($categoryIdArr)) { | ||
| 79 | + $categoryIdArr = array_filter($categoryIdArr); | ||
| 80 | + $categoryId = (int)array_shift($categoryIdArr); | ||
| 81 | + $newT[$key]["category_id"] = $categoryId; | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + //视频 | ||
| 85 | + $newT[$key]["video"] = !empty($item->video) ? json_decode($item->video) : null; | ||
| 86 | + $newT[$key]["image"] = !empty($item->image) ? $pageService->getImageUrl($item->image) : ""; | ||
| 87 | + $newT[$key]["content"] = !empty($item->content) ? $item->content : ""; | ||
| 88 | + $newT[$key]["name"] = !empty($item->name) ? $item->name : ""; | ||
| 89 | + $newT[$key]["remark"] = $remark; | ||
| 90 | + if (isset($item->release_at) && !empty(isset($item->release_at))) { | ||
| 91 | + $newT[$key]["created_at"] = $item->release_at; | ||
| 92 | + } else { | ||
| 93 | + $time = !empty($item->created_at) ? $item->created_at->toArray()['formatted'] : ""; | ||
| 94 | + $newT[$key]["created_at"] = $time; | ||
| 95 | + } | ||
| 96 | + $newT[$key]["created_at"] = strtotime($newT[$key]["created_at"]); | ||
| 97 | + $newT[$key]["created_at"] = date("Y-m-d", $newT[$key]["created_at"]); | ||
| 98 | + | ||
| 99 | + if (isset($newT[$key]["category_id"]) && !empty($newT[$key]["category_id"])) { | ||
| 100 | + $categoryInfo = CustomModuleCategory::getModuleCategoryAndExtendById($item->project_id, $newT[$key]["category_id"]); | ||
| 101 | + $newT[$key]["aUrl"] = !empty($categoryInfo) ? $categoryInfo->route . "/" . $item->route : ""; | ||
| 102 | + } else { | ||
| 103 | + $newT[$key]["aUrl"] = !empty($item->route) ? $moduleCategoryInfo->route . "/" . $item->route : ""; | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + } | ||
| 107 | + return $newT; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + /** | ||
| 111 | + * 根据模块查找自定义模块分类数据 | ||
| 112 | + */ | ||
| 113 | + public static function getModuleCategory($projectId, $modules) | ||
| 114 | + { | ||
| 115 | + $moduleCategoryInfo = null; | ||
| 116 | + if (isset($modules->category_id) && !empty($modules->category_id) && $modules->category_id != ",,") { | ||
| 117 | + $cateArr = explode(",", $modules->category_id); | ||
| 118 | + $cateArr = array_filter($cateArr); | ||
| 119 | + if (!empty($cateArr)) { | ||
| 120 | + $cateId = (int)array_shift($cateArr); | ||
| 121 | + $moduleCategoryInfo = CustomModuleCategory::getModuleCategoryAndExtendById($projectId, $cateId); | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + return $moduleCategoryInfo; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + /** | ||
| 128 | + * 是否是自定义扩展模块 | ||
| 129 | + */ | ||
| 130 | + public static function isModule($moduleDataModule) | ||
| 131 | + { | ||
| 132 | + $moduleDataModuleArr = explode("-", $moduleDataModule); | ||
| 133 | + if (count($moduleDataModuleArr) == 2) { | ||
| 134 | + $moduleArr = $moduleDataModuleArr; | ||
| 135 | + if (!empty($moduleArr)) { | ||
| 136 | + $moduleArr[0] = isset($moduleArr[0]) && !empty($moduleArr[0]) ? $moduleArr[0] : null; | ||
| 137 | + $moduleArr[1] = isset($moduleArr[1]) && !empty($moduleArr[1]) ? (int)$moduleArr[1] : null; | ||
| 138 | + } | ||
| 139 | + return $moduleArr; | ||
| 140 | + } else { | ||
| 141 | +// return $moduleDataModule; | ||
| 142 | + return null; | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + } | ||
| 38 | } | 146 | } |
| @@ -26,6 +26,60 @@ class Category extends Base | @@ -26,6 +26,60 @@ class Category extends Base | ||
| 26 | public static $productSearchPagePercent = 12; | 26 | public static $productSearchPagePercent = 12; |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | + * 根据分类ID查询上面所有父级,递归 | ||
| 30 | + */ | ||
| 31 | + public static function getAllFatherCategory($categoryId): array | ||
| 32 | + { | ||
| 33 | + $category = self::find($categoryId); | ||
| 34 | + return $category->getAncestorsRecursive(); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 根据产品分类获取分类列表和产品 | ||
| 39 | + */ | ||
| 40 | + public static function getCategoryBySelfCategory($projectId,$routerMap) | ||
| 41 | + { | ||
| 42 | + if ($routerMap->source_id == 0){ | ||
| 43 | + $categoryList = Category::with("products")->where("project_id",$projectId)->where("pid",0)->where("status",1)->orderBy("sort","desc")->orderBy("id","desc")->get(); | ||
| 44 | + }else{ | ||
| 45 | + $categoryIds = []; | ||
| 46 | + $category = Category::where("project_id",$projectId)->where("pid",$routerMap->source_id)->where("status",1)->orderBy("sort","desc")->orderBy("id","desc")->get(); | ||
| 47 | + if (count($category)>=1){ | ||
| 48 | + foreach ($category as $categoryItem){ | ||
| 49 | + $categoryIds[] = $categoryItem->id; | ||
| 50 | + } | ||
| 51 | + }else{ | ||
| 52 | + $categoryIds[] = $routerMap->source_id; | ||
| 53 | + } | ||
| 54 | + $categoryList = Category::with("products")->where("project_id",$projectId)->whereIn("id",$categoryIds)->where("status",1)->orderBy("sort","desc")->orderBy("id","desc")->get(); | ||
| 55 | + } | ||
| 56 | + return $categoryList; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 森联数据处理 | ||
| 61 | + */ | ||
| 62 | + public static function getSenLianCategoryAndProducts($routerMap) | ||
| 63 | + { | ||
| 64 | + $data = []; | ||
| 65 | + //下级分类及产品+产品扩展型号 | ||
| 66 | + $categorys = null; | ||
| 67 | + $sonData = self::with("productsSl")->where("project_id",$routerMap->project_id)->where("status",1)->where("pid",$routerMap->source_id)->orderBy("id","desc")->get(); | ||
| 68 | + if ($routerMap->route == "products" || !empty($sonData)){ | ||
| 69 | + if ($routerMap->route == "products"){ | ||
| 70 | + $categorys = self::with("productsSl")->where("project_id",$routerMap->project_id)->where("status",1)->where("pid",0)->where("route","!=","products")->orderBy("id","desc")->get(); | ||
| 71 | + }else{ | ||
| 72 | + $categorys = $sonData; | ||
| 73 | + } | ||
| 74 | + } | ||
| 75 | + if (!empty($categorys)){ | ||
| 76 | + $categorys = $categorys->toArray(); | ||
| 77 | + } | ||
| 78 | + $data["categorySon"] = $categorys; | ||
| 79 | + return $data; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + /** | ||
| 29 | * 获取指定分类的所有子分类IDS(包括自己) | 83 | * 获取指定分类的所有子分类IDS(包括自己) |
| 30 | * @param $id | 84 | * @param $id |
| 31 | * @return array | 85 | * @return array |
| @@ -17,4 +17,10 @@ class Extend extends Base | @@ -17,4 +17,10 @@ class Extend extends Base | ||
| 17 | protected $table = 'gl_product_extend'; | 17 | protected $table = 'gl_product_extend'; |
| 18 | //连接数据库 | 18 | //连接数据库 |
| 19 | protected $connection = 'custom_mysql'; | 19 | protected $connection = 'custom_mysql'; |
| 20 | + | ||
| 21 | + //产品详情扩展字段类型 1,文本输入框 2,代码块 3,图片列表 4,文件列表 | ||
| 22 | + public static $textExtendType = 1; | ||
| 23 | + public static $codeExtendType = 2; | ||
| 24 | + public static $imageExtendType = 3; | ||
| 25 | + public static $fileExtendType = 4; | ||
| 20 | } | 26 | } |
| @@ -17,4 +17,76 @@ class ExtendInfo extends Base | @@ -17,4 +17,76 @@ class ExtendInfo extends Base | ||
| 17 | protected $table = 'gl_product_extend_info'; | 17 | protected $table = 'gl_product_extend_info'; |
| 18 | //连接数据库 | 18 | //连接数据库 |
| 19 | protected $connection = 'custom_mysql'; | 19 | protected $connection = 'custom_mysql'; |
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 搜索模块-广州万天实业有限公司-项目ID:194,获取产品品牌和型号扩展字段的值 | ||
| 23 | + * key值固定为:pd_extended_field_1:品牌,pd_extended_field_2:型号 | ||
| 24 | + */ | ||
| 25 | + public static function getProductsAllBrandAndModel($projectId): array | ||
| 26 | + { | ||
| 27 | + $brandAndModel = []; | ||
| 28 | + $brandArr = []; | ||
| 29 | + $productIds = []; | ||
| 30 | + $productsExtendInfo = self::where("project_id",$projectId)->get(); | ||
| 31 | + if (!empty($productsExtendInfo)){ | ||
| 32 | + $productsExtendBrandInfo = $productsExtendInfo->where("key","pd_extended_field_1"); | ||
| 33 | + if (!empty($productsExtendBrandInfo)){ | ||
| 34 | + foreach ($productsExtendBrandInfo as $productsExtendBrandInfoItem){ | ||
| 35 | + if (!empty($productsExtendBrandInfoItem->values)){ | ||
| 36 | + $brand = explode(",",$productsExtendBrandInfoItem->values); | ||
| 37 | + $brands = array_filter($brand); | ||
| 38 | + if (!empty($brands)){ | ||
| 39 | + foreach ($brands as $brandsItem){ | ||
| 40 | + $brandArr[] = $brandsItem; | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + //临时数据 | ||
| 48 | + if (!empty($brandArr)){ | ||
| 49 | + $brandArr = array_unique($brandArr); | ||
| 50 | + $key = 0; | ||
| 51 | + foreach ($brandArr as $brandArrItem){ | ||
| 52 | + $brandKeys = $productsExtendInfo->where("key","pd_extended_field_1"); | ||
| 53 | + if (!empty($brandKeys)){ | ||
| 54 | + foreach ($brandKeys as $brandKeysItem){ | ||
| 55 | + if ($brandKeysItem->values){ | ||
| 56 | + if (strpos($brandKeysItem->values, $brandArrItem) !== false){ | ||
| 57 | + $brandAndModel[$key]["ids"][] = $brandKeysItem->product_id; | ||
| 58 | + $brandAndModel[$key]["brand"] = $brandArrItem; | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | + $key++; | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + if (!empty($brandAndModel)){ | ||
| 68 | + foreach ($brandAndModel as $keyItem=>$brandAndModelItem){ | ||
| 69 | + if (!empty($brandAndModelItem["ids"])){ | ||
| 70 | + $productIds = array_unique($brandAndModelItem["ids"]); | ||
| 71 | + $modelKeys = $productsExtendInfo->where("key","pd_extended_field_2")->whereIn("product_id",$productIds); | ||
| 72 | + $models = []; | ||
| 73 | + if (!empty($modelKeys)){ | ||
| 74 | + foreach ($modelKeys as $modelKeysItem){ | ||
| 75 | + if (!empty($modelKeysItem->values)){ | ||
| 76 | + $modelArr = array_filter(explode(",",$modelKeysItem->values)); | ||
| 77 | + foreach ($modelArr as $modelArrItem){ | ||
| 78 | + $models[] = $modelArrItem; | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + if (!empty($models)){ | ||
| 84 | + $models = array_unique($models); | ||
| 85 | + $brandAndModel[$keyItem]["model"] = $models; | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + } | ||
| 90 | + return $brandAndModel; | ||
| 91 | + } | ||
| 20 | } | 92 | } |
| @@ -4,6 +4,7 @@ namespace App\Models\Product; | @@ -4,6 +4,7 @@ namespace App\Models\Product; | ||
| 4 | 4 | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | use App\Models\Base; | 6 | use App\Models\Base; |
| 7 | +use Illuminate\Database\Eloquent\Relations\BelongsToMany; | ||
| 7 | use Illuminate\Database\Eloquent\SoftDeletes; | 8 | use Illuminate\Database\Eloquent\SoftDeletes; |
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| @@ -209,4 +210,15 @@ class Product extends Base | @@ -209,4 +210,15 @@ class Product extends Base | ||
| 209 | } | 210 | } |
| 210 | return $value; | 211 | return $value; |
| 211 | } | 212 | } |
| 213 | + | ||
| 214 | + /** | ||
| 215 | + * 多对多关联 | ||
| 216 | + * @return BelongsToMany | ||
| 217 | + * @author zbj | ||
| 218 | + * @date 2024/1/22 | ||
| 219 | + */ | ||
| 220 | + public function category(): BelongsToMany | ||
| 221 | + { | ||
| 222 | + return $this->belongsToMany(Category::class, 'gl_product_category_related', 'product_id', 'cate_id'); | ||
| 223 | + } | ||
| 212 | } | 224 | } |
| @@ -3,8 +3,29 @@ | @@ -3,8 +3,29 @@ | ||
| 3 | namespace App\Models\Project; | 3 | namespace App\Models\Project; |
| 4 | 4 | ||
| 5 | use App\Models\Base; | 5 | use App\Models\Base; |
| 6 | +use App\Models\WebSetting\WebLanguage; | ||
| 7 | +use App\Models\WebSetting\WebSetting; | ||
| 8 | +use Illuminate\Support\Facades\Redis; | ||
| 6 | 9 | ||
| 7 | class Country extends Base | 10 | class Country extends Base |
| 8 | { | 11 | { |
| 9 | protected $table = 'gl_project_country'; | 12 | protected $table = 'gl_project_country'; |
| 13 | + | ||
| 14 | + public static function getProjectCountry($projectId) | ||
| 15 | + { | ||
| 16 | + if (Redis::get("project_" . $projectId . "_country") == null) { | ||
| 17 | + $country = Country::where("project_id", $projectId)->first(); | ||
| 18 | + if (!empty($country)) { | ||
| 19 | +// $webCountry = WebLanguage::with("countryCustom")->whereIn("id", explode(",", $country->country_lists))->get(); | ||
| 20 | + $webCountry = WebLanguage::with(["countryCustom" => function($query) use ($projectId) { | ||
| 21 | + $query->where('project_id', $projectId); | ||
| 22 | + }])->whereIn("id", explode(",", $country->country_lists))->orderByRaw(DB::raw("FIND_IN_SET(id,'" . $country->country_lists. "'" . ')'))->get(); | ||
| 23 | + } else { | ||
| 24 | + $webCountry = null; | ||
| 25 | + } | ||
| 26 | + Redis::set("project_" . $projectId . "_country", json_encode($webCountry)); | ||
| 27 | + Redis::expire("project_" . $projectId . "_country", WebSetting::$redisExpireTime); | ||
| 28 | + } | ||
| 29 | + return json_decode(Redis::get("project_".$projectId."_country")); | ||
| 30 | + } | ||
| 10 | } | 31 | } |
app/Models/Template/BSettingTemplate.php
已删除
100644 → 0
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -namespace App\Models\Template; | ||
| 4 | - | ||
| 5 | -use App\Models\Base; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * @remark :默认主题 | ||
| 9 | - * @name :Setting | ||
| 10 | - * @author :lyh | ||
| 11 | - * @time :2023/6/28 16:51 | ||
| 12 | - */ | ||
| 13 | -class BSettingTemplate extends Base | ||
| 14 | -{ | ||
| 15 | - protected $table = 'gl_web_setting_template'; | ||
| 16 | - //连接数据库 | ||
| 17 | - protected $connection = 'custom_mysql'; | ||
| 18 | -} |
| @@ -16,4 +16,5 @@ class BTemplateCommon extends Base | @@ -16,4 +16,5 @@ class BTemplateCommon extends Base | ||
| 16 | protected $table = 'gl_web_template_common'; | 16 | protected $table = 'gl_web_template_common'; |
| 17 | //连接数据库 | 17 | //连接数据库 |
| 18 | protected $connection = 'custom_mysql'; | 18 | protected $connection = 'custom_mysql'; |
| 19 | + | ||
| 19 | } | 20 | } |
| @@ -13,4 +13,12 @@ use App\Models\Base; | @@ -13,4 +13,12 @@ use App\Models\Base; | ||
| 13 | class Setting extends Base | 13 | class Setting extends Base |
| 14 | { | 14 | { |
| 15 | protected $table = 'gl_web_setting_template'; | 15 | protected $table = 'gl_web_setting_template'; |
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 获取项目模板信息 | ||
| 19 | + */ | ||
| 20 | + public static function getProjectTemplateInfo($projectId) | ||
| 21 | + { | ||
| 22 | + return self::where("project_id",$projectId)->first(); | ||
| 23 | + } | ||
| 16 | } | 24 | } |
app/Models/Template/TemplateProject.php
已删除
100644 → 0
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * @remark : | ||
| 4 | - * @name :TemplateProject.php | ||
| 5 | - * @author :lyh | ||
| 6 | - * @method :post | ||
| 7 | - * @time :2023/11/15 14:38 | ||
| 8 | - */ | ||
| 9 | - | ||
| 10 | -namespace App\Models\Template; | ||
| 11 | - | ||
| 12 | -use App\Models\Base; | ||
| 13 | - | ||
| 14 | -class TemplateProject extends Base | ||
| 15 | -{ | ||
| 16 | - protected $table = 'gl_web_setting_template'; | ||
| 17 | - //连接数据库 | ||
| 18 | - protected $connection = 'custom_mysql'; | ||
| 19 | -} |
| @@ -10,13 +10,30 @@ | @@ -10,13 +10,30 @@ | ||
| 10 | namespace App\Models\WebSetting; | 10 | namespace App\Models\WebSetting; |
| 11 | 11 | ||
| 12 | use App\Models\Base; | 12 | use App\Models\Base; |
| 13 | +use App\Models\Project\CountryCustom; | ||
| 13 | use Illuminate\Support\Facades\Cache; | 14 | use Illuminate\Support\Facades\Cache; |
| 14 | 15 | ||
| 15 | class WebLanguage extends Base | 16 | class WebLanguage extends Base |
| 16 | { | 17 | { |
| 17 | protected $table = 'gl_web_language'; | 18 | protected $table = 'gl_web_language'; |
| 18 | 19 | ||
| 19 | - | 20 | + /** |
| 21 | + * 关键词17种语种 | ||
| 22 | + */ | ||
| 23 | + public static function getKeywordsCountry($project = null) | ||
| 24 | + { | ||
| 25 | + $languageIds = [1,4,5,6,7,8,9,10,11,14,15,18,22,26,40,68,78,95,99]; | ||
| 26 | + //加入项目主语种 | ||
| 27 | + if (!empty($project)){ | ||
| 28 | + $mainLangId = $project->main_lang_id; | ||
| 29 | + array_unshift($languageIds,(int)$mainLangId); | ||
| 30 | + } | ||
| 31 | + $projectId = $project->id; | ||
| 32 | + $languageIds=array_unique($languageIds); | ||
| 33 | + return WebLanguage::with(["countryCustom" => function($query) use ($projectId) { | ||
| 34 | + $query->where('project_id', $projectId); | ||
| 35 | + }])->whereIn("id",$languageIds)->get(); | ||
| 36 | + } | ||
| 20 | /** | 37 | /** |
| 21 | * @param $id | 38 | * @param $id |
| 22 | * @return mixed | 39 | * @return mixed |
| @@ -75,4 +92,12 @@ class WebLanguage extends Base | @@ -75,4 +92,12 @@ class WebLanguage extends Base | ||
| 75 | return array_unique($languageIds); | 92 | return array_unique($languageIds); |
| 76 | } | 93 | } |
| 77 | 94 | ||
| 95 | + /** | ||
| 96 | + * 关联语种自定义跳转设置 | ||
| 97 | + */ | ||
| 98 | + public function countryCustom(): \Illuminate\Database\Eloquent\Relations\HasOne | ||
| 99 | + { | ||
| 100 | + return $this->hasOne(CountryCustom::class, 'language_id', 'id'); | ||
| 101 | + } | ||
| 102 | + | ||
| 78 | } | 103 | } |
| @@ -8,7 +8,7 @@ use App\Models\Collect\CollectTask; | @@ -8,7 +8,7 @@ use App\Models\Collect\CollectTask; | ||
| 8 | use App\Models\Com\Notify; | 8 | use App\Models\Com\Notify; |
| 9 | use App\Models\Com\UpdateNotify; | 9 | use App\Models\Com\UpdateNotify; |
| 10 | use App\Models\Com\UpdateProgress; | 10 | use App\Models\Com\UpdateProgress; |
| 11 | -use App\Models\CustomModule\CustomModule; | 11 | +use App\Models\CustomModule\CustomModuleContent; |
| 12 | use App\Models\CustomModule\CustomModuleCategory; | 12 | use App\Models\CustomModule\CustomModuleCategory; |
| 13 | use App\Models\News\News; | 13 | use App\Models\News\News; |
| 14 | use App\Models\News\NewsCategory; | 14 | use App\Models\News\NewsCategory; |
| @@ -472,7 +472,7 @@ class CreatePageService{ | @@ -472,7 +472,7 @@ class CreatePageService{ | ||
| 472 | $tdkService = new TdkService(); | 472 | $tdkService = new TdkService(); |
| 473 | //页面路由 | 473 | //页面路由 |
| 474 | $routePath = $routerMap->route; | 474 | $routePath = $routerMap->route; |
| 475 | - $module_detail = CustomModule::where("project_id",$project->id)->where("id",$routerMap->source_id)->where("status",0)->first(); | 475 | + $module_detail = CustomModuleContent::where("project_id",$project->id)->where("id",$routerMap->source_id)->where("status",0)->first(); |
| 476 | if (!empty($module_detail)){ | 476 | if (!empty($module_detail)){ |
| 477 | if($project['update_info']['is_update'] && $module_detail->six_read){ | 477 | if($project['update_info']['is_update'] && $module_detail->six_read){ |
| 478 | return $this->getOldHtml($project,$routerMap,$project['update_info']['old_domain_test'],$project['update_info']['old_domain_online'],$lang); | 478 | return $this->getOldHtml($project,$routerMap,$project['update_info']['old_domain_test'],$project['update_info']['old_domain_online'],$lang); |
| @@ -481,7 +481,7 @@ class CreatePageService{ | @@ -481,7 +481,7 @@ class CreatePageService{ | ||
| 481 | $webCustomHtml = $pageService->publicMontagePage($project,RouteMap::SOURCE_MODULE,$routerMap); | 481 | $webCustomHtml = $pageService->publicMontagePage($project,RouteMap::SOURCE_MODULE,$routerMap); |
| 482 | //公共面包屑导航,左侧导航处理,内页banner背景图,列表页分页 | 482 | //公共面包屑导航,左侧导航处理,内页banner背景图,列表页分页 |
| 483 | $webCustomHtml = $pageService->publicMdAndLeftNavInnerImageListDetailsDataHandle($webCustomHtml,$project,RouteMap::SOURCE_MODULE,$routerMap,null); | 483 | $webCustomHtml = $pageService->publicMdAndLeftNavInnerImageListDetailsDataHandle($webCustomHtml,$project,RouteMap::SOURCE_MODULE,$routerMap,null); |
| 484 | - $moduleCategoryInfo = CustomModule::getModuleCategory($project->id,$module_detail); | 484 | + $moduleCategoryInfo = CustomModuleContent::getModuleCategory($project->id,$module_detail); |
| 485 | if (isset($moduleCategoryInfo->getExtend->detail_visualization) && $moduleCategoryInfo->getExtend->detail_visualization == 1){ | 485 | if (isset($moduleCategoryInfo->getExtend->detail_visualization) && $moduleCategoryInfo->getExtend->detail_visualization == 1){ |
| 486 | //产品,产品分类,新闻,博客(section模板通用数据模块处理) | 486 | //产品,产品分类,新闻,博客(section模板通用数据模块处理) |
| 487 | $webCustomHtml = $pageService->generalTemplateProcessingForDataModules($webCustomHtml,$project->id); | 487 | $webCustomHtml = $pageService->generalTemplateProcessingForDataModules($webCustomHtml,$project->id); |
| @@ -957,8 +957,8 @@ class CreatePageService{ | @@ -957,8 +957,8 @@ class CreatePageService{ | ||
| 957 | }elseif($routerMap->source == "blog"){ | 957 | }elseif($routerMap->source == "blog"){ |
| 958 | $route = "/blogs/".$route; | 958 | $route = "/blogs/".$route; |
| 959 | }elseif($routerMap->source == "module"){ | 959 | }elseif($routerMap->source == "module"){ |
| 960 | - $modules = CustomModule::where("project_id",$project->id)->where("id",$routerMap->source_id)->where("status",0)->first(); | ||
| 961 | - $moduleCategoryInfo = CustomModule::getModuleCategory($project->id,$modules); | 960 | + $modules = CustomModuleContent::where("project_id",$project->id)->where("id",$routerMap->source_id)->where("status",0)->first(); |
| 961 | + $moduleCategoryInfo = CustomModuleContent::getModuleCategory($project->id,$modules); | ||
| 962 | if (isset($moduleCategoryInfo->route) && !empty($moduleCategoryInfo->route)){ | 962 | if (isset($moduleCategoryInfo->route) && !empty($moduleCategoryInfo->route)){ |
| 963 | $route = "/".$moduleCategoryInfo->route."/".$route; | 963 | $route = "/".$moduleCategoryInfo->route."/".$route; |
| 964 | } | 964 | } |
| @@ -1021,8 +1021,8 @@ class CreatePageService{ | @@ -1021,8 +1021,8 @@ class CreatePageService{ | ||
| 1021 | $route = "/".$moduleCategory->route."/page"; | 1021 | $route = "/".$moduleCategory->route."/page"; |
| 1022 | } | 1022 | } |
| 1023 | }elseif ($routerMap->source == "module"){ | 1023 | }elseif ($routerMap->source == "module"){ |
| 1024 | - $modules = CustomModule::where("project_id",$project->id)->where("id",$routerMap->source_id)->where("status",0)->first(); | ||
| 1025 | - $moduleCategoryInfo = CustomModule::getModuleCategory($project->id,$modules); | 1024 | + $modules = CustomModuleContent::where("project_id",$project->id)->where("id",$routerMap->source_id)->where("status",0)->first(); |
| 1025 | + $moduleCategoryInfo = CustomModuleContent::getModuleCategory($project->id,$modules); | ||
| 1026 | if (isset($moduleCategoryInfo->getExtend->route) && !empty($moduleCategoryInfo->getExtend->route)){ | 1026 | if (isset($moduleCategoryInfo->getExtend->route) && !empty($moduleCategoryInfo->getExtend->route)){ |
| 1027 | $route = "/".$moduleCategoryInfo->route."/".$modules->route; | 1027 | $route = "/".$moduleCategoryInfo->route."/".$modules->route; |
| 1028 | }else{ | 1028 | }else{ |
| @@ -1109,8 +1109,8 @@ class CreatePageService{ | @@ -1109,8 +1109,8 @@ class CreatePageService{ | ||
| 1109 | }elseif($routerMap->source == "blog"){ | 1109 | }elseif($routerMap->source == "blog"){ |
| 1110 | $route = "/blogs/".$route; | 1110 | $route = "/blogs/".$route; |
| 1111 | }elseif($routerMap->source == "module"){ | 1111 | }elseif($routerMap->source == "module"){ |
| 1112 | - $modules = CustomModule::where("project_id",$project->id)->where("id",$routerMap->source_id)->where("status",0)->first(); | ||
| 1113 | - $moduleCategoryInfo = CustomModule::getModuleCategory($project->id,$modules); | 1112 | + $modules = CustomModuleContent::where("project_id",$project->id)->where("id",$routerMap->source_id)->where("status",0)->first(); |
| 1113 | + $moduleCategoryInfo = CustomModuleContent::getModuleCategory($project->id,$modules); | ||
| 1114 | if (isset($moduleCategoryInfo->route) && !empty($moduleCategoryInfo->route)){ | 1114 | if (isset($moduleCategoryInfo->route) && !empty($moduleCategoryInfo->route)){ |
| 1115 | $route = "/".$moduleCategoryInfo->route."/".$route; | 1115 | $route = "/".$moduleCategoryInfo->route."/".$route; |
| 1116 | } | 1116 | } |
| @@ -1153,8 +1153,8 @@ class CreatePageService{ | @@ -1153,8 +1153,8 @@ class CreatePageService{ | ||
| 1153 | }elseif ($routerMap->source == "product_category"){ | 1153 | }elseif ($routerMap->source == "product_category"){ |
| 1154 | $route = "/".$route."/page"; | 1154 | $route = "/".$route."/page"; |
| 1155 | }elseif ($routerMap->source == "module"){ | 1155 | }elseif ($routerMap->source == "module"){ |
| 1156 | - $modules = CustomModule::where("project_id",$project->id)->where("id",$routerMap->source_id)->where("status",0)->first(); | ||
| 1157 | - $moduleCategoryInfo = CustomModule::getModuleCategory($project->id,$modules); | 1156 | + $modules = CustomModuleContent::where("project_id",$project->id)->where("id",$routerMap->source_id)->where("status",0)->first(); |
| 1157 | + $moduleCategoryInfo = CustomModuleContent::getModuleCategory($project->id,$modules); | ||
| 1158 | if (isset($moduleCategoryInfo->getExtend->route) && !empty($moduleCategoryInfo->getExtend->route)){ | 1158 | if (isset($moduleCategoryInfo->getExtend->route) && !empty($moduleCategoryInfo->getExtend->route)){ |
| 1159 | $route = "/".$moduleCategoryInfo->getExtend->route."_catalog/".$moduleCategoryInfo->route."/page"; | 1159 | $route = "/".$moduleCategoryInfo->getExtend->route."_catalog/".$moduleCategoryInfo->route."/page"; |
| 1160 | }else{ | 1160 | }else{ |
| @@ -5,6 +5,7 @@ namespace App\Services\Html; | @@ -5,6 +5,7 @@ namespace App\Services\Html; | ||
| 5 | 5 | ||
| 6 | use App\Models\Blog\Blog; | 6 | use App\Models\Blog\Blog; |
| 7 | use App\Models\CustomModule\CustomModule; | 7 | use App\Models\CustomModule\CustomModule; |
| 8 | +use App\Models\CustomModule\CustomModuleContent; | ||
| 8 | use App\Models\Domain\DomainInfo; | 9 | use App\Models\Domain\DomainInfo; |
| 9 | use App\Models\Module\Module; | 10 | use App\Models\Module\Module; |
| 10 | use App\Models\News\News; | 11 | use App\Models\News\News; |
| @@ -807,7 +808,7 @@ tr.stripe { background-color:#f7f7f7; } | @@ -807,7 +808,7 @@ tr.stripe { background-color:#f7f7f7; } | ||
| 807 | $botNum = $outerNum+1 == 1 ? "" : "_".($outerNum+1); | 808 | $botNum = $outerNum+1 == 1 ? "" : "_".($outerNum+1); |
| 808 | $moduleCategoryUrlItem = ''; | 809 | $moduleCategoryUrlItem = ''; |
| 809 | foreach ($moduleCategory as $moduleCategoryItem){ | 810 | foreach ($moduleCategory as $moduleCategoryItem){ |
| 810 | - $count = CustomModule::where("project_id",$item["project_id"])->where("category_id","like","%,".(string)$moduleCategoryItem->source_id.",%")->where("status",0)->count(); | 811 | + $count = CustomModuleContent::where("project_id",$item["project_id"])->where("category_id","like","%,".(string)$moduleCategoryItem->source_id.",%")->where("status",0)->count(); |
| 811 | $innerNum++; | 812 | $innerNum++; |
| 812 | if ($count >= 1){ | 813 | if ($count >= 1){ |
| 813 | $webSettingNum = SettingNum::where("project_id",$item["project_id"])->where("type",SettingNum::$newsListType)->orderBy("id","desc")->first(); | 814 | $webSettingNum = SettingNum::where("project_id",$item["project_id"])->where("type",SettingNum::$newsListType)->orderBy("id","desc")->first(); |
| @@ -1093,8 +1094,8 @@ tr.stripe { background-color:#f7f7f7; } | @@ -1093,8 +1094,8 @@ tr.stripe { background-color:#f7f7f7; } | ||
| 1093 | $data = RouteMap::where("project_id",$item["project_id"])->where("source","module")->offset($offset)->limit($perPage)->get(); | 1094 | $data = RouteMap::where("project_id",$item["project_id"])->where("source","module")->offset($offset)->limit($perPage)->get(); |
| 1094 | if (!empty($data)){ | 1095 | if (!empty($data)){ |
| 1095 | foreach ($data as $j){ | 1096 | foreach ($data as $j){ |
| 1096 | - $module_detail = CustomModule::where("project_id",$item["project_id"])->where("id",$j->source_id)->where("status",0)->first(); | ||
| 1097 | - $moduleAndCategoryInfo = CustomModule::getModuleCategory($item["project_id"],$module_detail); | 1097 | + $module_detail = CustomModuleContent::where("project_id",$item["project_id"])->where("id",$j->source_id)->where("status",0)->first(); |
| 1098 | + $moduleAndCategoryInfo = CustomModuleContent::getModuleCategory($item["project_id"],$module_detail); | ||
| 1098 | if (!empty($module_detail) && !empty($moduleAndCategoryInfo)){ | 1099 | if (!empty($module_detail) && !empty($moduleAndCategoryInfo)){ |
| 1099 | $isExistFile = $this->isExistHtmlFile($item['domain'],"",$j,$j->route,null); | 1100 | $isExistFile = $this->isExistHtmlFile($item['domain'],"",$j,$j->route,null); |
| 1100 | if ($isExistFile){ | 1101 | if ($isExistFile){ |
此 diff 太大无法显示。
| @@ -23,7 +23,9 @@ Route::get('optimize_project_list', [\App\Http\Controllers\Api\PrivateController | @@ -23,7 +23,9 @@ Route::get('optimize_project_list', [\App\Http\Controllers\Api\PrivateController | ||
| 23 | Route::get('get_project_route', [\App\Http\Controllers\Api\PrivateController::class, 'getProjectRoute'])->name('api.get_project_route'); | 23 | Route::get('get_project_route', [\App\Http\Controllers\Api\PrivateController::class, 'getProjectRoute'])->name('api.get_project_route'); |
| 24 | Route::any('get_product_images', [\App\Http\Controllers\Api\ProductController::class, 'getImages'])->name('api.get_product_images'); | 24 | Route::any('get_product_images', [\App\Http\Controllers\Api\ProductController::class, 'getImages'])->name('api.get_product_images'); |
| 25 | Route::any('saveProduct', [\App\Http\Controllers\Api\ProductController::class, 'saveProduct'])->name('api.saveProduct'); | 25 | Route::any('saveProduct', [\App\Http\Controllers\Api\ProductController::class, 'saveProduct'])->name('api.saveProduct'); |
| 26 | +Route::any('searchProduct', [\App\Http\Controllers\Api\ProductController::class, 'searchProduct'])->name('api.searchProduct'); | ||
| 26 | Route::post('inquiry_submit', [\App\Http\Controllers\Api\InquiryController::class, 'submit'])->name('api.inquiry_submit'); | 27 | Route::post('inquiry_submit', [\App\Http\Controllers\Api\InquiryController::class, 'submit'])->name('api.inquiry_submit'); |
| 28 | +Route::post('editInquiryStatus', [\App\Http\Controllers\Api\InquiryController::class, 'editInquiryStatus'])->name('api.inquiry_editInquiryStatus'); | ||
| 27 | Route::any('getOptimizationReport', [\App\Http\Controllers\Api\OptimizationReportController::class, 'getOptimizationReport'])->name('api.getOptimizationReport'); | 29 | Route::any('getOptimizationReport', [\App\Http\Controllers\Api\OptimizationReportController::class, 'getOptimizationReport'])->name('api.getOptimizationReport'); |
| 28 | // 视频任务回调信息 | 30 | // 视频任务回调信息 |
| 29 | Route::post('video_task_callback', [\App\Http\Controllers\Api\NoticeController::class, 'videoTaskCallback'])->name('api.video_task_callback'); | 31 | Route::post('video_task_callback', [\App\Http\Controllers\Api\NoticeController::class, 'videoTaskCallback'])->name('api.video_task_callback'); |
-
请 注册 或 登录 后发表评论