Merge remote-tracking branch 'origin/master' into akun
正在显示
10 个修改的文件
包含
143 行增加
和
26 行删除
| @@ -83,17 +83,11 @@ class IndexController extends BaseController | @@ -83,17 +83,11 @@ class IndexController extends BaseController | ||
| 83 | $this->request->validate([ | 83 | $this->request->validate([ |
| 84 | 'data' => 'required|array', | 84 | 'data' => 'required|array', |
| 85 | 'identifying'=>'required', | 85 | 'identifying'=>'required', |
| 86 | - 'code'=>'required' | ||
| 87 | ], [ | 86 | ], [ |
| 88 | 'data.required' => '自定义询盘数据不为空', | 87 | 'data.required' => '自定义询盘数据不为空', |
| 89 | 'data.array' => '必须为数组', | 88 | 'data.array' => '必须为数组', |
| 90 | 'identifying.required' => '唯一标识不为空', | 89 | 'identifying.required' => '唯一标识不为空', |
| 91 | - 'code'=>'加密串不能为空' | ||
| 92 | ]); | 90 | ]); |
| 93 | - $code = base64_encode(md5($this->param['identifying'])); | ||
| 94 | - if($code != $this->param['code']){ | ||
| 95 | - $this->response('签名错误',Code::SYSTEM_ERROR); | ||
| 96 | - } | ||
| 97 | $inquiryModel = new InquiryData(); | 91 | $inquiryModel = new InquiryData(); |
| 98 | $rs = $inquiryModel->add($this->param); | 92 | $rs = $inquiryModel->add($this->param); |
| 99 | if($rs === false){ | 93 | if($rs === false){ |
| @@ -101,5 +95,5 @@ class IndexController extends BaseController | @@ -101,5 +95,5 @@ class IndexController extends BaseController | ||
| 101 | } | 95 | } |
| 102 | $this->response('success'); | 96 | $this->response('success'); |
| 103 | } | 97 | } |
| 104 | - | 98 | + |
| 105 | } | 99 | } |
| @@ -817,11 +817,41 @@ class ProjectController extends BaseController | @@ -817,11 +817,41 @@ class ProjectController extends BaseController | ||
| 817 | * @time :2023/11/17 15:23 | 817 | * @time :2023/11/17 15:23 |
| 818 | */ | 818 | */ |
| 819 | public function saveOtherProject(ProjectLogic $logic){ | 819 | public function saveOtherProject(ProjectLogic $logic){ |
| 820 | + $this->request->validate([ | ||
| 821 | + 'id'=>'required', | ||
| 822 | + 'aicc'=>'required', | ||
| 823 | + 'hagro'=>'required', | ||
| 824 | + 'exclusive_aicc_day'=>'required', | ||
| 825 | + 'exclusive_hagro_day'=>'required', | ||
| 826 | + ],[ | ||
| 827 | + 'id.required' => 'id不能为空', | ||
| 828 | + 'aicc.required' => 'aicc是否开启不能为空', | ||
| 829 | + 'hagro.required' => 'hagro是否开启不能为空', | ||
| 830 | + 'exclusive_aicc_day.required' => '服务天数不能为空', | ||
| 831 | + 'exclusive_hagro_day.required' => '服务天数不能为空', | ||
| 832 | + ]); | ||
| 820 | $logic->saveOtherProject(); | 833 | $logic->saveOtherProject(); |
| 821 | $this->response('success'); | 834 | $this->response('success'); |
| 822 | } | 835 | } |
| 823 | 836 | ||
| 824 | /** | 837 | /** |
| 838 | + * @remark :获取其他项目配置 | ||
| 839 | + * @name :getOtherProject | ||
| 840 | + * @author :lyh | ||
| 841 | + * @method :post | ||
| 842 | + * @time :2023/11/17 15:23 | ||
| 843 | + */ | ||
| 844 | + public function getOtherProject(ProjectLogic $logic){ | ||
| 845 | + $this->request->validate([ | ||
| 846 | + 'id'=>'required', | ||
| 847 | + ],[ | ||
| 848 | + 'id.required' => 'id不能为空', | ||
| 849 | + ]); | ||
| 850 | + $info = $logic->getOtherProject(); | ||
| 851 | + $this->response('success',Code::SUCCESS,$info); | ||
| 852 | + } | ||
| 853 | + | ||
| 854 | + /** | ||
| 825 | * @remark :获取渠道信息 | 855 | * @remark :获取渠道信息 |
| 826 | * @name :getChannel | 856 | * @name :getChannel |
| 827 | * @author :lyh | 857 | * @author :lyh |
| @@ -110,4 +110,13 @@ class NavController extends BaseController | @@ -110,4 +110,13 @@ class NavController extends BaseController | ||
| 110 | $navLogic->navSort(); | 110 | $navLogic->navSort(); |
| 111 | $this->response('success'); | 111 | $this->response('success'); |
| 112 | } | 112 | } |
| 113 | + | ||
| 114 | + /** | ||
| 115 | + * 一键导入子菜单 | ||
| 116 | + * @author zbj | ||
| 117 | + * @date 2023/11/21 | ||
| 118 | + */ | ||
| 119 | + public function import(){ | ||
| 120 | + | ||
| 121 | + } | ||
| 113 | } | 122 | } |
| @@ -710,4 +710,16 @@ class ProjectLogic extends BaseLogic | @@ -710,4 +710,16 @@ class ProjectLogic extends BaseLogic | ||
| 710 | return $this->success($this->param); | 710 | return $this->success($this->param); |
| 711 | } | 711 | } |
| 712 | 712 | ||
| 713 | + /** | ||
| 714 | + * @remark :获取其他配置 | ||
| 715 | + * @name :getOtherProject | ||
| 716 | + * @author :lyh | ||
| 717 | + * @method :post | ||
| 718 | + * @time :2023/11/21 15:45 | ||
| 719 | + */ | ||
| 720 | + public function getOtherProject(){ | ||
| 721 | + $info = $this->model->read(['id'=>$this->param['id']],['aicc','hagro','exclusive_aicc_day','exclusive_hagro_day']); | ||
| 722 | + return $this->success($info); | ||
| 723 | + } | ||
| 724 | + | ||
| 713 | } | 725 | } |
| @@ -51,8 +51,8 @@ class ProductLogic extends BaseLogic | @@ -51,8 +51,8 @@ class ProductLogic extends BaseLogic | ||
| 51 | $category_ids = $this->getLastCategoryArr($this->param['category_id']); | 51 | $category_ids = $this->getLastCategoryArr($this->param['category_id']); |
| 52 | $this->param['category_id'] = ','.implode(',',$category_ids).','; | 52 | $this->param['category_id'] = ','.implode(',',$category_ids).','; |
| 53 | } | 53 | } |
| 54 | - DB::connection('custom_mysql')->beginTransaction(); | ||
| 55 | - try { | 54 | +// DB::connection('custom_mysql')->beginTransaction(); |
| 55 | +// try { | ||
| 56 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 56 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 57 | $id = $this->param['id']; | 57 | $id = $this->param['id']; |
| 58 | //查看路由是否更新 | 58 | //查看路由是否更新 |
| @@ -68,11 +68,11 @@ class ProductLogic extends BaseLogic | @@ -68,11 +68,11 @@ class ProductLogic extends BaseLogic | ||
| 68 | CategoryRelated::saveRelated($id, $category_ids); | 68 | CategoryRelated::saveRelated($id, $category_ids); |
| 69 | //保存扩展字段 | 69 | //保存扩展字段 |
| 70 | $this->saveExtendInfo($id,$extend); | 70 | $this->saveExtendInfo($id,$extend); |
| 71 | - DB::connection('custom_mysql')->commit(); | ||
| 72 | - }catch (\Exception $e){ | ||
| 73 | - DB::connection('custom_mysql')->rollBack(); | ||
| 74 | - $this->fail('系统错误请联系管理员'); | ||
| 75 | - } | 71 | +// DB::connection('custom_mysql')->commit(); |
| 72 | +// }catch (\Exception $e){ | ||
| 73 | +// DB::connection('custom_mysql')->rollBack(); | ||
| 74 | +// $this->fail('系统错误请联系管理员'); | ||
| 75 | +// } | ||
| 76 | //通知更新 | 76 | //通知更新 |
| 77 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT, 'route'=>$this->param['route']]); | 77 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT, 'route'=>$this->param['route']]); |
| 78 | return $this->success(); | 78 | return $this->success(); |
| @@ -144,7 +144,7 @@ class ProductLogic extends BaseLogic | @@ -144,7 +144,7 @@ class ProductLogic extends BaseLogic | ||
| 144 | $this->param['thumb'] = Arr::a2s($this->param['gallery'][0] ?? []); | 144 | $this->param['thumb'] = Arr::a2s($this->param['gallery'][0] ?? []); |
| 145 | $this->param['gallery'] = Arr::a2s($this->param['gallery'] ?? []); | 145 | $this->param['gallery'] = Arr::a2s($this->param['gallery'] ?? []); |
| 146 | }else{ | 146 | }else{ |
| 147 | - $this->param['thumb'] = []; | 147 | + $this->param['thumb'] = Arr::a2s([]); |
| 148 | } | 148 | } |
| 149 | $this->model->edit($this->param,['id'=>$this->param['id']]); | 149 | $this->model->edit($this->param,['id'=>$this->param['id']]); |
| 150 | return $this->success(); | 150 | return $this->success(); |
| @@ -202,7 +202,7 @@ class ProductLogic extends BaseLogic | @@ -202,7 +202,7 @@ class ProductLogic extends BaseLogic | ||
| 202 | $param['thumb'] = Arr::a2s($param['gallery'][0] ?? []); | 202 | $param['thumb'] = Arr::a2s($param['gallery'][0] ?? []); |
| 203 | $param['gallery'] = Arr::a2s($param['gallery'] ?? []); | 203 | $param['gallery'] = Arr::a2s($param['gallery'] ?? []); |
| 204 | }else{ | 204 | }else{ |
| 205 | - $param['thumb'] = []; | 205 | + $param['thumb'] = Arr::a2s([]); |
| 206 | } | 206 | } |
| 207 | $param['attrs'] = Arr::a2s($param['attrs'] ?? []); | 207 | $param['attrs'] = Arr::a2s($param['attrs'] ?? []); |
| 208 | $param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? ''); | 208 | $param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? ''); |
| @@ -21,6 +21,7 @@ class BNav extends Base | @@ -21,6 +21,7 @@ class BNav extends Base | ||
| 21 | use SoftDeletes; | 21 | use SoftDeletes; |
| 22 | 22 | ||
| 23 | public $hidden = ['deleted_at']; | 23 | public $hidden = ['deleted_at']; |
| 24 | + public $appends = ['able_import']; | ||
| 24 | 25 | ||
| 25 | 26 | ||
| 26 | /** | 27 | /** |
| @@ -74,4 +75,19 @@ class BNav extends Base | @@ -74,4 +75,19 @@ class BNav extends Base | ||
| 74 | $value = getImageUrl($value); | 75 | $value = getImageUrl($value); |
| 75 | return $value; | 76 | return $value; |
| 76 | } | 77 | } |
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 是否支持一键导入 | ||
| 81 | + * @param $value | ||
| 82 | + * @return int | ||
| 83 | + * @author zbj | ||
| 84 | + * @date 2023/11/21 | ||
| 85 | + */ | ||
| 86 | + public function getAbleImportAttribute($value) | ||
| 87 | + { | ||
| 88 | + if(in_array($this->url, ['products','news','blogs'])){ | ||
| 89 | + return 1; | ||
| 90 | + } | ||
| 91 | + return 0; | ||
| 92 | + } | ||
| 77 | } | 93 | } |
| @@ -81,7 +81,9 @@ class Product extends Base | @@ -81,7 +81,9 @@ class Product extends Base | ||
| 81 | public function getThumbAttribute($value){ | 81 | public function getThumbAttribute($value){ |
| 82 | if(!empty($value)){ | 82 | if(!empty($value)){ |
| 83 | $value = json_decode($value,true); | 83 | $value = json_decode($value,true); |
| 84 | - $value['url'] = getImageUrl($value['url']); | 84 | + if(!empty($value['url'])){ |
| 85 | + $value['url'] = getImageUrl($value['url']); | ||
| 86 | + } | ||
| 85 | } | 87 | } |
| 86 | return $value; | 88 | return $value; |
| 87 | } | 89 | } |
| @@ -91,7 +93,9 @@ class Product extends Base | @@ -91,7 +93,9 @@ class Product extends Base | ||
| 91 | if(!empty($value)){ | 93 | if(!empty($value)){ |
| 92 | $value = Arr::s2a($value); | 94 | $value = Arr::s2a($value); |
| 93 | foreach ($value as $k => $v){ | 95 | foreach ($value as $k => $v){ |
| 94 | - $v['url'] = getImageUrl($v['url']); | 96 | + if(!empty($v['url'])){ |
| 97 | + $v['url'] = getImageUrl($v['url']); | ||
| 98 | + } | ||
| 95 | $value[$k] = $v; | 99 | $value[$k] = $v; |
| 96 | } | 100 | } |
| 97 | } | 101 | } |
| @@ -5,6 +5,8 @@ namespace App\Models\RouteMap; | @@ -5,6 +5,8 @@ namespace App\Models\RouteMap; | ||
| 5 | use App\Helper\Translate; | 5 | use App\Helper\Translate; |
| 6 | use App\Http\Logic\Aside\Project\ProjectLogic; | 6 | use App\Http\Logic\Aside\Project\ProjectLogic; |
| 7 | use App\Models\Base; | 7 | use App\Models\Base; |
| 8 | +use App\Models\Project\Project; | ||
| 9 | +use App\Models\Template\BTemplate; | ||
| 8 | 10 | ||
| 9 | /** | 11 | /** |
| 10 | * 路由映射表 | 12 | * 路由映射表 |
| @@ -55,7 +57,7 @@ class RouteMap extends Base | @@ -55,7 +57,7 @@ class RouteMap extends Base | ||
| 55 | $sign = generateRoute($title); | 57 | $sign = generateRoute($title); |
| 56 | $route = $sign; | 58 | $route = $sign; |
| 57 | while(self::isExist($route, $source, $source_id, $project_id)){ | 59 | while(self::isExist($route, $source, $source_id, $project_id)){ |
| 58 | - $route = $sign .'-'.$i; | 60 | + $route = $sign .'-'.$i; |
| 59 | $i++; | 61 | $i++; |
| 60 | } | 62 | } |
| 61 | return $route; | 63 | return $route; |
| @@ -112,19 +114,20 @@ class RouteMap extends Base | @@ -112,19 +114,20 @@ class RouteMap extends Base | ||
| 112 | $project = ProjectLogic::instance()->getInfo($project_id); | 114 | $project = ProjectLogic::instance()->getInfo($project_id); |
| 113 | if($project['type'] !== Project::STATUS_ONE){ | 115 | if($project['type'] !== Project::STATUS_ONE){ |
| 114 | return $route_map->route; | 116 | return $route_map->route; |
| 115 | -// throw new \Exception('站点已上线,禁止修改链接'); | ||
| 116 | } | 117 | } |
| 117 | } | 118 | } |
| 118 | if(!$route_map){ | 119 | if(!$route_map){ |
| 119 | $route_map = new self(); | 120 | $route_map = new self(); |
| 120 | $route_map->source = $source; | 121 | $route_map->source = $source; |
| 122 | + $route_map->source_id = $source_id; | ||
| 123 | + $route_map->project_id = $project_id; | ||
| 121 | if ($source == self::SOURCE_PRODUCT_KEYWORD){ | 124 | if ($source == self::SOURCE_PRODUCT_KEYWORD){ |
| 122 | - $route = $route.'-tag'; | 125 | + $route = self::setKeywordRoute($route); |
| 126 | + //查看当前路由是否存在 | ||
| 123 | }elseif ($source == self::SOURCE_PRODUCT){ | 127 | }elseif ($source == self::SOURCE_PRODUCT){ |
| 124 | - $route = $route.'-product'; | 128 | + //产品单独处理路由 |
| 129 | + $route = self::setProductRoute($route); | ||
| 125 | } | 130 | } |
| 126 | - $route_map->source_id = $source_id; | ||
| 127 | - $route_map->project_id = $project_id; | ||
| 128 | } | 131 | } |
| 129 | if($source == self::SOURCE_NEWS){ | 132 | if($source == self::SOURCE_NEWS){ |
| 130 | $route_map->path = self::SOURCE_NEWS; | 133 | $route_map->path = self::SOURCE_NEWS; |
| @@ -141,6 +144,46 @@ class RouteMap extends Base | @@ -141,6 +144,46 @@ class RouteMap extends Base | ||
| 141 | 144 | ||
| 142 | 145 | ||
| 143 | /** | 146 | /** |
| 147 | + * @remark :产品新增单独处理路由 | ||
| 148 | + * @name :setProductRoute | ||
| 149 | + * @author :lyh | ||
| 150 | + * @method :post | ||
| 151 | + * @time :2023/11/21 18:48 | ||
| 152 | + */ | ||
| 153 | + public static function setProductRoute($route,$i = 0){ | ||
| 154 | + $route = $route.'-product'; | ||
| 155 | + $routeMapModel = new RouteMap(); | ||
| 156 | + $routeInfo = $routeMapModel->read(['route'=>$route]); | ||
| 157 | + if($routeInfo === false){ | ||
| 158 | + return $route; | ||
| 159 | + }else{ | ||
| 160 | + $i = $i + 1; | ||
| 161 | + $route = $route.'-'.$i; | ||
| 162 | + return self::setProductRoute($route,$i); | ||
| 163 | + } | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + /** | ||
| 167 | + * @remark :关键字新增单独处理路由 | ||
| 168 | + * @name :setProductRoute | ||
| 169 | + * @author :lyh | ||
| 170 | + * @method :post | ||
| 171 | + * @time :2023/11/21 18:48 | ||
| 172 | + */ | ||
| 173 | + public static function setKeywordRoute($route,$i = 0){ | ||
| 174 | + $route = $route.'-tag'; | ||
| 175 | + $routeMapModel = new RouteMap(); | ||
| 176 | + $routeInfo = $routeMapModel->read(['route'=>$route]); | ||
| 177 | + if($routeInfo === false){ | ||
| 178 | + return $route; | ||
| 179 | + }else{ | ||
| 180 | + $i = $i + 1; | ||
| 181 | + $route = $route.'-'.$i; | ||
| 182 | + return self::setProductRoute($route,$i); | ||
| 183 | + } | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + /** | ||
| 144 | * @param $route | 187 | * @param $route |
| 145 | * @param $project_id | 188 | * @param $project_id |
| 146 | * @return mixed | 189 | * @return mixed |
| @@ -16,10 +16,18 @@ class BTemplate extends Base | @@ -16,10 +16,18 @@ class BTemplate extends Base | ||
| 16 | const SOURCE_PRODUCT = 2;//产品 | 16 | const SOURCE_PRODUCT = 2;//产品 |
| 17 | const SOURCE_BLOG = 3;//博客 | 17 | const SOURCE_BLOG = 3;//博客 |
| 18 | const SOURCE_NEWS = 4;//新闻详情页 | 18 | const SOURCE_NEWS = 4;//新闻详情页 |
| 19 | - | ||
| 20 | - | 19 | + const SOURCE_KEYWORD = 5;//聚合页 |
| 21 | const STATUS = 0; | 20 | const STATUS = 0; |
| 22 | 21 | ||
| 22 | + const TYPE_ONE = 0; | ||
| 23 | + const TYPE_TWO = 0; | ||
| 24 | + const TYPE_THREE = 0; | ||
| 25 | + const TYPE_FOUR = 0; | ||
| 26 | + const TYPE_FIVE = 0; | ||
| 27 | + const TYPE_SIX = 0; | ||
| 28 | + const TYPE_SEVEN = 0; | ||
| 29 | + const TYPE_ = 0; | ||
| 30 | + | ||
| 23 | protected $table = 'gl_web_template'; | 31 | protected $table = 'gl_web_template'; |
| 24 | //连接数据库 | 32 | //连接数据库 |
| 25 | protected $connection = 'custom_mysql'; | 33 | protected $connection = 'custom_mysql'; |
| @@ -172,6 +172,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -172,6 +172,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 172 | Route::any('/copyProject', [Aside\Project\ProjectController::class, 'copyProject'])->name('admin.project_copyProject'); | 172 | Route::any('/copyProject', [Aside\Project\ProjectController::class, 'copyProject'])->name('admin.project_copyProject'); |
| 173 | Route::any('/site_token', [Aside\Project\ProjectController::class, 'site_token'])->name('admin.project_site_token'); | 173 | Route::any('/site_token', [Aside\Project\ProjectController::class, 'site_token'])->name('admin.project_site_token'); |
| 174 | Route::any('/saveOtherProject', [Aside\Project\ProjectController::class, 'saveOtherProject'])->name('admin.project_saveOtherProject');//其他项目设置 | 174 | Route::any('/saveOtherProject', [Aside\Project\ProjectController::class, 'saveOtherProject'])->name('admin.project_saveOtherProject');//其他项目设置 |
| 175 | + Route::any('/getOtherProject', [Aside\Project\ProjectController::class, 'getOtherProject'])->name('admin.project_getOtherProject');//获取其他项目设置 | ||
| 175 | Route::any('/getChannel', [Aside\Project\ProjectController::class, 'getChannel'])->name('admin.project_getChannel');//其他项目设置 | 176 | Route::any('/getChannel', [Aside\Project\ProjectController::class, 'getChannel'])->name('admin.project_getChannel');//其他项目设置 |
| 176 | //获取关键词前缀和后缀 | 177 | //获取关键词前缀和后缀 |
| 177 | Route::prefix('keyword')->group(function () { | 178 | Route::prefix('keyword')->group(function () { |
-
请 注册 或 登录 后发表评论