合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !3015
正在显示
7 个修改的文件
包含
127 行增加
和
56 行删除
| @@ -100,7 +100,9 @@ class UpdateKeyword extends Command | @@ -100,7 +100,9 @@ class UpdateKeyword extends Command | ||
| 100 | }else{ | 100 | }else{ |
| 101 | $randomNumber = $text[$key] ?? rand(0, $number - 1); | 101 | $randomNumber = $text[$key] ?? rand(0, $number - 1); |
| 102 | } | 102 | } |
| 103 | - $keywordModel->edit(['keyword_content'=>$text[$randomNumber]],['title'=>$item]); | 103 | + if(isset($text[$randomNumber])){ |
| 104 | + $keywordModel->edit(['keyword_content'=>$text[$randomNumber]],['title'=>$item]); | ||
| 105 | + } | ||
| 104 | } | 106 | } |
| 105 | } | 107 | } |
| 106 | //按给定的数量更新 | 108 | //按给定的数量更新 |
| @@ -112,7 +114,9 @@ class UpdateKeyword extends Command | @@ -112,7 +114,9 @@ class UpdateKeyword extends Command | ||
| 112 | }else{ | 114 | }else{ |
| 113 | $randomNumber = $text[$key] ?? rand(0, $number - 1); | 115 | $randomNumber = $text[$key] ?? rand(0, $number - 1); |
| 114 | } | 116 | } |
| 115 | - $keywordModel->edit(['keyword_content'=>$text[$randomNumber]],['title'=>$item]); | 117 | + if(isset($text[$randomNumber])){ |
| 118 | + $keywordModel->edit(['keyword_content'=>$text[$randomNumber]],['title'=>$item]); | ||
| 119 | + } | ||
| 116 | } | 120 | } |
| 117 | } | 121 | } |
| 118 | } | 122 | } |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :GeoConfirmController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/10/25 11:35 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Aside\Geo; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Controllers\Aside\BaseController; | ||
| 14 | +use App\Http\Logic\Aside\Geo\GeoConfirmLogic; | ||
| 15 | +use Illuminate\Http\Request; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * @remark :用户确认信息表 | ||
| 19 | + * @name :GeoConfirmController | ||
| 20 | + * @author :lyh | ||
| 21 | + * @method :post | ||
| 22 | + * @time :2025/10/25 11:37 | ||
| 23 | + */ | ||
| 24 | +class GeoConfirmController extends BaseController | ||
| 25 | +{ | ||
| 26 | + public function __construct(){ | ||
| 27 | + parent::__construct(); | ||
| 28 | + $this->logic = new GeoConfirmLogic(); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 保存确认数据, 并推送微信群 | ||
| 33 | + * @param Request $request | ||
| 34 | + * @throws \App\Exceptions\AsideGlobalException | ||
| 35 | + */ | ||
| 36 | + public function saveConfirmContent() | ||
| 37 | + { | ||
| 38 | + $this->request->validate([ | ||
| 39 | + 'project_id' => 'required', | ||
| 40 | + 'type' => 'required|integer', | ||
| 41 | + 'content' => 'required', | ||
| 42 | + 'max_num' => 'required', | ||
| 43 | + ], [ | ||
| 44 | + 'project_id.required' => '项目ID不能为空', | ||
| 45 | + 'type.required' => '确定数据类型不能为空', | ||
| 46 | + 'type.integer' => '确定数据类型不正确', | ||
| 47 | + 'content.required' => '确定数据不能为空', | ||
| 48 | + 'max_num.required' => '最大确认数量不能为空', | ||
| 49 | + ]); | ||
| 50 | + $data = $this->logic->saveConfirmContent($this->param); | ||
| 51 | + $this->response('success', Code::SUCCESS, $data); | ||
| 52 | + } | ||
| 53 | +} |
| @@ -70,37 +70,6 @@ class GeoController extends BaseController | @@ -70,37 +70,6 @@ class GeoController extends BaseController | ||
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | 72 | ||
| 73 | - /** | ||
| 74 | - * 保存确认数据, 并推送微信群 | ||
| 75 | - * @param Request $request | ||
| 76 | - * @throws \App\Exceptions\AsideGlobalException | ||
| 77 | - */ | ||
| 78 | - public function saveConfirmContent() | ||
| 79 | - { | ||
| 80 | - $this->request->validate([ | ||
| 81 | - 'project_id' => 'required', | ||
| 82 | - 'type' => 'required|integer', | ||
| 83 | - 'content' => 'required', | ||
| 84 | - 'max_num' => 'required', | ||
| 85 | - ], [ | ||
| 86 | - 'project_id.required' => '项目ID不能为空', | ||
| 87 | - 'type.required' => '确定数据类型不能为空', | ||
| 88 | - 'type.integer' => '确定数据类型不正确', | ||
| 89 | - 'content.required' => '确定数据不能为空', | ||
| 90 | - 'max_num.required' => '最大确认数量不能为空', | ||
| 91 | - ]); | ||
| 92 | - try { | ||
| 93 | - $data = GeoConfirm::saveContent($this->param['project_id'], $this->param['type'], $this->param['content'], $this->param['max_num']); | ||
| 94 | - $friend = ProjectAssociation::where(['project_id' => $this->param['project_id']])->first(); | ||
| 95 | - if (empty($friend)){ | ||
| 96 | - $this->fail('项目未绑定微信群, 推送消息失败!'); | ||
| 97 | - } | ||
| 98 | - $data = GeoConfirm::sendConfirmMessage($data->id, $friend->friend_id); | ||
| 99 | - $this->response('success', Code::SUCCESS, $data); | ||
| 100 | - } catch (\Exception $e) { | ||
| 101 | - $this->fail('操作失败, error:' . $e->getMessage()); | ||
| 102 | - } | ||
| 103 | - } | ||
| 104 | 73 | ||
| 105 | /** | 74 | /** |
| 106 | * OA后台管理员,保存确认数据 | 75 | * OA后台管理员,保存确认数据 |
app/Http/Logic/Aside/Geo/GeoConfirmLogic.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :GeoConfirmLogic.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/10/25 11:36 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Logic\Aside\Geo; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 14 | +use App\Models\Geo\GeoConfirm; | ||
| 15 | +use App\Models\ProjectAssociation\ProjectAssociation; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * @remark :用户确认信息 | ||
| 19 | + * @name :GeoConfirmLogic | ||
| 20 | + * @author :lyh | ||
| 21 | + * @method :post | ||
| 22 | + * @time :2025/10/25 11:37 | ||
| 23 | + */ | ||
| 24 | +class GeoConfirmLogic extends BaseLogic | ||
| 25 | +{ | ||
| 26 | + public function __construct() | ||
| 27 | + { | ||
| 28 | + parent::__construct(); | ||
| 29 | + $this->param = $this->requestAll; | ||
| 30 | + $this->model = new GeoConfirm(); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * @remark :保存数据->并推送微信群客户确认 | ||
| 35 | + * @name :saveConfirmContent | ||
| 36 | + * @author :lyh | ||
| 37 | + * @method :post | ||
| 38 | + * @time :2025/10/25 11:41 | ||
| 39 | + */ | ||
| 40 | + public function saveConfirmContent($param) | ||
| 41 | + { | ||
| 42 | + try { | ||
| 43 | + $info = $this->model->read(['project_id' => $param['project_id']]); | ||
| 44 | + if($info === false){ | ||
| 45 | + $id = $this->model->addReturnId($param); | ||
| 46 | + }else{ | ||
| 47 | + $id = $param['id']; | ||
| 48 | + $this->model->edit($param,['id'=>$info['id']]); | ||
| 49 | + } | ||
| 50 | + $friend = ProjectAssociation::where(['project_id' => $param['project_id']])->first(); | ||
| 51 | + if (empty($friend)){ | ||
| 52 | + $this->fail('项目未绑定微信群, 推送消息失败!'); | ||
| 53 | + } | ||
| 54 | + GeoConfirm::sendConfirmMessage($id, $friend->friend_id); | ||
| 55 | + } catch (\Exception $e) { | ||
| 56 | + $this->fail('操作失败, error:' . $e->getMessage()); | ||
| 57 | + } | ||
| 58 | + return $this->success(['id'=>$id]); | ||
| 59 | + } | ||
| 60 | +} |
| @@ -76,8 +76,9 @@ class GeoLogic extends BaseLogic | @@ -76,8 +76,9 @@ class GeoLogic extends BaseLogic | ||
| 76 | * @author :lyh | 76 | * @author :lyh |
| 77 | * @method :post | 77 | * @method :post |
| 78 | * @time :2025/10/25 11:14 | 78 | * @time :2025/10/25 11:14 |
| 79 | - * @param :project_id->项目id;manager_id->管理员id;company->公司名称;brand->品牌名;description->描述(必传) | 79 | + * @param->gl_geo_conf : project_id->项目id;manager_id->管理员id;company->公司名称;brand->品牌名;description->描述(必传) |
| 80 | * @param :prefix->前缀;suffix->后缀(非必传) | 80 | * @param :prefix->前缀;suffix->后缀(非必传) |
| 81 | + * @param->gl_project : geo_status->开启/关闭状态 geo_qualify_num->达标数量 | ||
| 81 | */ | 82 | */ |
| 82 | public function saveConfig($param) | 83 | public function saveConfig($param) |
| 83 | { | 84 | { |
| @@ -97,4 +98,5 @@ class GeoLogic extends BaseLogic | @@ -97,4 +98,5 @@ class GeoLogic extends BaseLogic | ||
| 97 | } | 98 | } |
| 98 | return $this->success(['id'=>$id]); | 99 | return $this->success(['id'=>$id]); |
| 99 | } | 100 | } |
| 101 | + | ||
| 100 | } | 102 | } |
| @@ -60,26 +60,6 @@ class GeoConfirm extends Base | @@ -60,26 +60,6 @@ class GeoConfirm extends Base | ||
| 60 | ]; | 60 | ]; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | - /** | ||
| 64 | - * @param $project_id | ||
| 65 | - * @param $type | ||
| 66 | - * @param $content | ||
| 67 | - * @param $max_num | ||
| 68 | - * @return GeoConfirm | ||
| 69 | - */ | ||
| 70 | - public static function saveContent($project_id, $type, $content, $max_num) | ||
| 71 | - { | ||
| 72 | - $data = self::where(compact('project_id', 'type'))->first(); | ||
| 73 | - if (empty($data)) { | ||
| 74 | - $data = new self(); | ||
| 75 | - $data->project_id = $project_id; | ||
| 76 | - $data->type = $type; | ||
| 77 | - } | ||
| 78 | - $data->content = $content; | ||
| 79 | - $data->max_num = $max_num; | ||
| 80 | - $data->save(); | ||
| 81 | - return $data; | ||
| 82 | - } | ||
| 83 | 63 | ||
| 84 | /** | 64 | /** |
| 85 | * 保存确认数据 | 65 | * 保存确认数据 |
| @@ -586,11 +586,14 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -586,11 +586,14 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 586 | Route::any('/downloadGeoLink', [Aside\Geo\GeoLinkController::class, 'downloadGeoLink'])->name('admin.geo_link_downloadGeoLink'); | 586 | Route::any('/downloadGeoLink', [Aside\Geo\GeoLinkController::class, 'downloadGeoLink'])->name('admin.geo_link_downloadGeoLink'); |
| 587 | Route::any('/daResultData', [Aside\Geo\GeoLinkController::class, 'daResultData'])->name('admin.geo_link_daResultData'); | 587 | Route::any('/daResultData', [Aside\Geo\GeoLinkController::class, 'daResultData'])->name('admin.geo_link_daResultData'); |
| 588 | }); | 588 | }); |
| 589 | - //geo设置 | 589 | + //geo信息详情设置 |
| 590 | Route::prefix('conf')->group(function () { | 590 | Route::prefix('conf')->group(function () { |
| 591 | Route::any('/getConfig', [Aside\Geo\GeoController::class, 'getConfig'])->name('admin.geo_conf_getConfig'); | 591 | Route::any('/getConfig', [Aside\Geo\GeoController::class, 'getConfig'])->name('admin.geo_conf_getConfig'); |
| 592 | Route::any('/saveConfig', [Aside\Geo\GeoController::class, 'saveConfig'])->name('admin.geo_conf_saveConfig'); | 592 | Route::any('/saveConfig', [Aside\Geo\GeoController::class, 'saveConfig'])->name('admin.geo_conf_saveConfig'); |
| 593 | - Route::any('/saveConfirmContent', [Aside\Geo\GeoController::class, 'saveConfirmContent'])->name('admin.geo_conf_saveConfirmContent'); | 593 | + }); |
| 594 | + //geo客户确认信息 | ||
| 595 | + Route::prefix('confirm')->group(function () { | ||
| 596 | + Route::any('/saveConfirmContent', [Aside\Geo\GeoConfirmController::class, 'saveConfirmContent'])->name('admin.geo_confirm_saveConfirmContent'); | ||
| 594 | }); | 597 | }); |
| 595 | }); | 598 | }); |
| 596 | // 任务相关 | 599 | // 任务相关 |
-
请 注册 或 登录 后发表评论