Merge remote-tracking branch 'origin/develop' into develop
正在显示
43 个修改的文件
包含
714 行增加
和
252 行删除
| @@ -3,7 +3,6 @@ | @@ -3,7 +3,6 @@ | ||
| 3 | namespace App\Console\Commands\MonthlyCount; | 3 | namespace App\Console\Commands\MonthlyCount; |
| 4 | 4 | ||
| 5 | use App\Helper\FormGlobalsoApi; | 5 | use App\Helper\FormGlobalsoApi; |
| 6 | -use App\Models\Project\DeployBuild; | ||
| 7 | use Carbon\Carbon; | 6 | use Carbon\Carbon; |
| 8 | use Illuminate\Console\Command; | 7 | use Illuminate\Console\Command; |
| 9 | use Illuminate\Support\Facades\DB; | 8 | use Illuminate\Support\Facades\DB; |
| @@ -74,11 +73,13 @@ class InquiryMonthlyCount extends Command | @@ -74,11 +73,13 @@ class InquiryMonthlyCount extends Command | ||
| 74 | public function inquiryCount(&$arr,&$startTime,&$endTime,$domain){ | 73 | public function inquiryCount(&$arr,&$startTime,&$endTime,$domain){ |
| 75 | $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); | 74 | $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); |
| 76 | //总数 | 75 | //总数 |
| 77 | - $arr['total'] = $inquiry_list['data']['total']; | 76 | + $arr['total'] = $inquiry_list['data']['total'] ?? 0; |
| 78 | //数据详情 | 77 | //数据详情 |
| 79 | - $data = $inquiry_list['data']['data']; | 78 | + $data = $inquiry_list['data']['data'] ?? 0; |
| 80 | $arr['month_total'] = 0; | 79 | $arr['month_total'] = 0; |
| 81 | $countryArr = []; | 80 | $countryArr = []; |
| 81 | + $arr['country'] = ""; | ||
| 82 | + if(!empty($data)){ | ||
| 82 | foreach ($data as $v){ | 83 | foreach ($data as $v){ |
| 83 | if(($startTime.' 00:00:00' <= $v['submit_time']) && $v['submit_time'] <= $endTime.' 23:59:59'){ | 84 | if(($startTime.' 00:00:00' <= $v['submit_time']) && $v['submit_time'] <= $endTime.' 23:59:59'){ |
| 84 | $arr['month_total']++; | 85 | $arr['month_total']++; |
| @@ -92,6 +93,7 @@ class InquiryMonthlyCount extends Command | @@ -92,6 +93,7 @@ class InquiryMonthlyCount extends Command | ||
| 92 | arsort($countryArr); | 93 | arsort($countryArr); |
| 93 | $top20 = array_slice($countryArr, 0, 15, true); | 94 | $top20 = array_slice($countryArr, 0, 15, true); |
| 94 | $arr['country'] = json_encode($top20); | 95 | $arr['country'] = json_encode($top20); |
| 96 | + } | ||
| 95 | return $arr; | 97 | return $arr; |
| 96 | } | 98 | } |
| 97 | 99 |
| @@ -6,6 +6,7 @@ use App\Helper\Arr; | @@ -6,6 +6,7 @@ use App\Helper\Arr; | ||
| 6 | use App\Helper\SemrushApi; | 6 | use App\Helper\SemrushApi; |
| 7 | use App\Models\RankData\ExternalLinks as ExternalLinksModel; | 7 | use App\Models\RankData\ExternalLinks as ExternalLinksModel; |
| 8 | use App\Models\Project\DeployOptimize; | 8 | use App\Models\Project\DeployOptimize; |
| 9 | +use App\Utils\LogUtils; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * Class ExternalLinks | 12 | * Class ExternalLinks |
| @@ -39,7 +40,7 @@ class ExternalLinks extends BaseCommands | @@ -39,7 +40,7 @@ class ExternalLinks extends BaseCommands | ||
| 39 | $semrushApi = new SemrushApi(); | 40 | $semrushApi = new SemrushApi(); |
| 40 | //有排名api编号的项目 | 41 | //有排名api编号的项目 |
| 41 | $list = DeployOptimize::where('api_no', '>', 0)->pluck('domain', 'project_id')->toArray(); | 42 | $list = DeployOptimize::where('api_no', '>', 0)->pluck('domain', 'project_id')->toArray(); |
| 42 | - | 43 | + LogUtils::info('start rank_data_external_links:' . count($list)); |
| 43 | foreach ($list as $project_id => $domain) { | 44 | foreach ($list as $project_id => $domain) { |
| 44 | if(!$domain){ | 45 | if(!$domain){ |
| 45 | continue; | 46 | continue; |
| @@ -5,6 +5,7 @@ namespace App\Console\Commands\RankData; | @@ -5,6 +5,7 @@ namespace App\Console\Commands\RankData; | ||
| 5 | use App\Helper\QuanqiusouApi; | 5 | use App\Helper\QuanqiusouApi; |
| 6 | use App\Models\Project\DeployOptimize; | 6 | use App\Models\Project\DeployOptimize; |
| 7 | use App\Models\RankData\IndexedPages as IndexedPagesModel; | 7 | use App\Models\RankData\IndexedPages as IndexedPagesModel; |
| 8 | +use App\Utils\LogUtils; | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| 10 | * Class IndexedPages | 11 | * Class IndexedPages |
| @@ -38,7 +39,7 @@ class IndexedPages extends BaseCommands | @@ -38,7 +39,7 @@ class IndexedPages extends BaseCommands | ||
| 38 | $api = new QuanqiusouApi(); | 39 | $api = new QuanqiusouApi(); |
| 39 | //有排名api编号的项目 | 40 | //有排名api编号的项目 |
| 40 | $list = DeployOptimize::where('api_no', '>', 0)->pluck('api_no', 'project_id')->toArray(); | 41 | $list = DeployOptimize::where('api_no', '>', 0)->pluck('api_no', 'project_id')->toArray(); |
| 41 | - | 42 | + LogUtils::info('start rank_data_indexed_pages:' . count($list)); |
| 42 | foreach ($list as $project_id => $api_no) { | 43 | foreach ($list as $project_id => $api_no) { |
| 43 | $model = IndexedPagesModel::where('project_id', $project_id)->first(); | 44 | $model = IndexedPagesModel::where('project_id', $project_id)->first(); |
| 44 | if($model && $model->updated_date == getThisWeekStarDate()){ | 45 | if($model && $model->updated_date == getThisWeekStarDate()){ |
| @@ -7,6 +7,7 @@ use App\Helper\QuanqiusouApi; | @@ -7,6 +7,7 @@ use App\Helper\QuanqiusouApi; | ||
| 7 | use App\Models\Project\DeployBuild; | 7 | use App\Models\Project\DeployBuild; |
| 8 | use App\Models\Project\DeployOptimize; | 8 | use App\Models\Project\DeployOptimize; |
| 9 | use App\Models\RankData\RankData as GoogleRankModel; | 9 | use App\Models\RankData\RankData as GoogleRankModel; |
| 10 | +use App\Utils\LogUtils; | ||
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| 12 | * Class GoogleRank | 13 | * Class GoogleRank |
| @@ -41,6 +42,7 @@ class RankData extends BaseCommands | @@ -41,6 +42,7 @@ class RankData extends BaseCommands | ||
| 41 | $api = new QuanqiusouApi(); | 42 | $api = new QuanqiusouApi(); |
| 42 | //有排名api编号的项目 | 43 | //有排名api编号的项目 |
| 43 | $list = DeployOptimize::where('api_no', '>' , 0)->select('api_no','minor_languages','project_id')->get(); | 44 | $list = DeployOptimize::where('api_no', '>' , 0)->select('api_no','minor_languages','project_id')->get(); |
| 45 | + LogUtils::info('start rank_data:' . count($list)); | ||
| 44 | //当日所有站点谷歌收录数据 | 46 | //当日所有站点谷歌收录数据 |
| 45 | $site_res = $api->getSiteRes(); | 47 | $site_res = $api->getSiteRes(); |
| 46 | if(!$site_res){ | 48 | if(!$site_res){ |
| @@ -7,6 +7,7 @@ use App\Helper\Arr; | @@ -7,6 +7,7 @@ use App\Helper\Arr; | ||
| 7 | use App\Helper\QuanqiusouApi; | 7 | use App\Helper\QuanqiusouApi; |
| 8 | use App\Models\Project\DeployOptimize; | 8 | use App\Models\Project\DeployOptimize; |
| 9 | use App\Models\RankData\RankWeek as RankWeekModel; | 9 | use App\Models\RankData\RankWeek as RankWeekModel; |
| 10 | +use App\Utils\LogUtils; | ||
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| 12 | * Class WeekRank | 13 | * Class WeekRank |
| @@ -49,7 +50,7 @@ class RankWeek extends BaseCommands | @@ -49,7 +50,7 @@ class RankWeek extends BaseCommands | ||
| 49 | $res = Arr::s2a($res); | 50 | $res = Arr::s2a($res); |
| 50 | //有排名api编号的项目 | 51 | //有排名api编号的项目 |
| 51 | $list = DeployOptimize::where('api_no', '>', 0)->pluck('api_no', 'project_id')->toArray(); | 52 | $list = DeployOptimize::where('api_no', '>', 0)->pluck('api_no', 'project_id')->toArray(); |
| 52 | - | 53 | + LogUtils::info('start rank_data_week:' . count($list)); |
| 53 | foreach ($list as $project_id => $api_no) { | 54 | foreach ($list as $project_id => $api_no) { |
| 54 | $rank_week = RankWeekModel::where('project_id', $project_id)->first(); | 55 | $rank_week = RankWeekModel::where('project_id', $project_id)->first(); |
| 55 | if ($rank_week && $rank_week->updated_date == getThisWeekStarDate()) { | 56 | if ($rank_week && $rank_week->updated_date == getThisWeekStarDate()) { |
| @@ -5,6 +5,7 @@ namespace App\Console\Commands\RankData; | @@ -5,6 +5,7 @@ namespace App\Console\Commands\RankData; | ||
| 5 | use App\Helper\SemrushApi; | 5 | use App\Helper\SemrushApi; |
| 6 | use App\Models\RankData\RecommDomain as RecommDomainModel; | 6 | use App\Models\RankData\RecommDomain as RecommDomainModel; |
| 7 | use App\Models\Project\DeployOptimize; | 7 | use App\Models\Project\DeployOptimize; |
| 8 | +use App\Utils\LogUtils; | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| 10 | * Class RecommDomain | 11 | * Class RecommDomain |
| @@ -38,7 +39,7 @@ class RecommDomain extends BaseCommands | @@ -38,7 +39,7 @@ class RecommDomain extends BaseCommands | ||
| 38 | $semrushApi = new SemrushApi(); | 39 | $semrushApi = new SemrushApi(); |
| 39 | //有排名api编号的项目 | 40 | //有排名api编号的项目 |
| 40 | $list = DeployOptimize::where('api_no', '>', 0)->pluck('domain', 'project_id')->toArray(); | 41 | $list = DeployOptimize::where('api_no', '>', 0)->pluck('domain', 'project_id')->toArray(); |
| 41 | - | 42 | + LogUtils::info('start rank_data_recomm_domain:' . count($list)); |
| 42 | foreach ($list as $project_id => $domain) { | 43 | foreach ($list as $project_id => $domain) { |
| 43 | if(!$domain){ | 44 | if(!$domain){ |
| 44 | continue; | 45 | continue; |
| @@ -6,6 +6,7 @@ use App\Helper\Arr; | @@ -6,6 +6,7 @@ use App\Helper\Arr; | ||
| 6 | use App\Helper\GoogleSpeedApi; | 6 | use App\Helper\GoogleSpeedApi; |
| 7 | use App\Models\Project\DeployOptimize; | 7 | use App\Models\Project\DeployOptimize; |
| 8 | use App\Models\RankData\Speed as GoogleSpeedModel; | 8 | use App\Models\RankData\Speed as GoogleSpeedModel; |
| 9 | +use App\Utils\LogUtils; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * Class GoogleSpeed | 12 | * Class GoogleSpeed |
| @@ -42,7 +43,7 @@ class Speed extends BaseCommands | @@ -42,7 +43,7 @@ class Speed extends BaseCommands | ||
| 42 | 43 | ||
| 43 | //有排名api编号的项目 | 44 | //有排名api编号的项目 |
| 44 | $list = DeployOptimize::where('api_no', '>', 0)->pluck('domain', 'project_id')->toArray(); | 45 | $list = DeployOptimize::where('api_no', '>', 0)->pluck('domain', 'project_id')->toArray(); |
| 45 | - | 46 | + LogUtils::info('start rank_data_speed:' . count($list)); |
| 46 | foreach ($list as $project_id => $domain) { | 47 | foreach ($list as $project_id => $domain) { |
| 47 | $model = GoogleSpeedModel::where('project_id', $project_id)->first(); | 48 | $model = GoogleSpeedModel::where('project_id', $project_id)->first(); |
| 48 | if ($model && $model->updated_date == getThisWeekStarDate()) { | 49 | if ($model && $model->updated_date == getThisWeekStarDate()) { |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace App\Console\Commands; | 3 | namespace App\Console\Commands; |
| 4 | 4 | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | +use App\Helper\Common; | ||
| 6 | use App\Helper\OaGlobalsoApi; | 7 | use App\Helper\OaGlobalsoApi; |
| 7 | use App\Models\Channel\Channel; | 8 | use App\Models\Channel\Channel; |
| 8 | use App\Models\Com\NoticeLog; | 9 | use App\Models\Com\NoticeLog; |
| @@ -16,6 +17,7 @@ use App\Utils\LogUtils; | @@ -16,6 +17,7 @@ use App\Utils\LogUtils; | ||
| 16 | use Hashids\Hashids; | 17 | use Hashids\Hashids; |
| 17 | use Illuminate\Console\Command; | 18 | use Illuminate\Console\Command; |
| 18 | use Illuminate\Support\Facades\DB; | 19 | use Illuminate\Support\Facades\DB; |
| 20 | +use Illuminate\Support\Facades\Http; | ||
| 19 | 21 | ||
| 20 | /** | 22 | /** |
| 21 | * 同步项目信息 | 23 | * 同步项目信息 |
| @@ -60,13 +62,21 @@ class SyncProject extends Command | @@ -60,13 +62,21 @@ class SyncProject extends Command | ||
| 60 | try { | 62 | try { |
| 61 | $api = new OaGlobalsoApi(); | 63 | $api = new OaGlobalsoApi(); |
| 62 | $data = $api->order_info($item['data']['order_id']); | 64 | $data = $api->order_info($item['data']['order_id']); |
| 63 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($data['data'], true) . PHP_EOL, FILE_APPEND); | ||
| 64 | if(!$data || empty($data['data'])){ | 65 | if(!$data || empty($data['data'])){ |
| 65 | LogUtils::error('OaGlobalsoApi order_info error', $data); | 66 | LogUtils::error('OaGlobalsoApi order_info error', $data); |
| 66 | $this->retry($item); | 67 | $this->retry($item); |
| 67 | } | 68 | } |
| 68 | if($data['data']['order_type'] == '首次'){ | 69 | if($data['data']['order_type'] == '首次'){ |
| 69 | $this->sync($data['data']); | 70 | $this->sync($data['data']); |
| 71 | + | ||
| 72 | + //同步aicc | ||
| 73 | + if($data['data']['exclusive_aicc']){ | ||
| 74 | + $this->toAicc($data['data']); | ||
| 75 | + } | ||
| 76 | + //同步hagro | ||
| 77 | + if($data['data']['exclusive_hagro']){ | ||
| 78 | + $this->toHagro($data['data']); | ||
| 79 | + } | ||
| 70 | } | 80 | } |
| 71 | if($data['data']['order_type'] == '续费'){ | 81 | if($data['data']['order_type'] == '续费'){ |
| 72 | $this->renewSync($data['data']); | 82 | $this->renewSync($data['data']); |
| @@ -112,7 +122,7 @@ class SyncProject extends Command | @@ -112,7 +122,7 @@ class SyncProject extends Command | ||
| 112 | 'cooperate_date' => date('Y-m-d', $param['create_time']), | 122 | 'cooperate_date' => date('Y-m-d', $param['create_time']), |
| 113 | 'service_duration' => $param['years'], | 123 | 'service_duration' => $param['years'], |
| 114 | 'plan' => $this->versionData($param['plan_marketing']), | 124 | 'plan' => $this->versionData($param['plan_marketing']), |
| 115 | - 'api_no' => $param['id'], | 125 | +// 'api_no' => $param['id'], //改手动填 |
| 116 | 'amount' => $param['plan_price'], | 126 | 'amount' => $param['plan_price'], |
| 117 | 'contract' => json_encode($param['files']), | 127 | 'contract' => json_encode($param['files']), |
| 118 | 'bill' => json_encode($param['images']), | 128 | 'bill' => json_encode($param['images']), |
| @@ -164,7 +174,9 @@ class SyncProject extends Command | @@ -164,7 +174,9 @@ class SyncProject extends Command | ||
| 164 | 'cooperate_date' => date('Y-m-d', $param['create_time']), | 174 | 'cooperate_date' => date('Y-m-d', $param['create_time']), |
| 165 | 'from_order_id' => $param['from_order_id'], | 175 | 'from_order_id' => $param['from_order_id'], |
| 166 | 'aicc' => $param['exclusive_aicc'], | 176 | 'aicc' => $param['exclusive_aicc'], |
| 177 | + "exclusive_aicc_day" => $param['exclusive_aicc_day'], | ||
| 167 | 'hagro' => $param['exclusive_hagro'], | 178 | 'hagro' => $param['exclusive_hagro'], |
| 179 | + "exclusive_hagro_day" => $param['exclusive_hagro_day'], | ||
| 168 | 'notice_order_id' => $param['id'], | 180 | 'notice_order_id' => $param['id'], |
| 169 | ], | 181 | ], |
| 170 | 'deploy_build' => [ | 182 | 'deploy_build' => [ |
| @@ -178,26 +190,22 @@ class SyncProject extends Command | @@ -178,26 +190,22 @@ class SyncProject extends Command | ||
| 178 | 'project_after' => [], | 190 | 'project_after' => [], |
| 179 | 'payment' => [ | 191 | 'payment' => [ |
| 180 | 'amount' => $param['plan_price'], | 192 | 'amount' => $param['plan_price'], |
| 181 | - 'contract' => !empty($param['files']) ? json_encode($param['files']) : " ", | ||
| 182 | - 'bill' => !empty($param['images']) ? json_encode($param['images']) : " ", | ||
| 183 | ], | 193 | ], |
| 184 | ]; | 194 | ]; |
| 195 | + if(!empty($param['files'])){ | ||
| 196 | + $data['payment']['contract'] = json_encode($param['files']); | ||
| 197 | + } | ||
| 198 | + if(!empty($param['images'])){ | ||
| 199 | + $data['payment']['bill'] = json_encode($param['images']); | ||
| 200 | + } | ||
| 185 | DB::beginTransaction(); | 201 | DB::beginTransaction(); |
| 186 | try { | 202 | try { |
| 187 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export(1111, true) . PHP_EOL, FILE_APPEND); | ||
| 188 | $id = $this->saveProject($data['project']); | 203 | $id = $this->saveProject($data['project']); |
| 189 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($id, true) . PHP_EOL, FILE_APPEND); | ||
| 190 | - $this->setPostId($data['deploy_build']['plan'],$id); | ||
| 191 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export(222, true) . PHP_EOL, FILE_APPEND); | ||
| 192 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($data['payment'], true) . PHP_EOL, FILE_APPEND); | 204 | + $this->setPostId($data['deploy_build']['plan'],$id);; |
| 193 | $this->savePayment($data['payment'],$id); | 205 | $this->savePayment($data['payment'],$id); |
| 194 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export(444, true) . PHP_EOL, FILE_APPEND); | ||
| 195 | $this->saveDeployBuild($data['deploy_build'],$id); | 206 | $this->saveDeployBuild($data['deploy_build'],$id); |
| 196 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export(555, true) . PHP_EOL, FILE_APPEND); | ||
| 197 | $this->saveDeployOptimize($data['deploy_optimize'],$id); | 207 | $this->saveDeployOptimize($data['deploy_optimize'],$id); |
| 198 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export(666, true) . PHP_EOL, FILE_APPEND); | ||
| 199 | $this->saveAfter($data['project_after'],$id); | 208 | $this->saveAfter($data['project_after'],$id); |
| 200 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export(777, true) . PHP_EOL, FILE_APPEND); | ||
| 201 | DB::commit(); | 209 | DB::commit(); |
| 202 | }catch (\Exception $e){ | 210 | }catch (\Exception $e){ |
| 203 | DB::rollBack(); | 211 | DB::rollBack(); |
| @@ -230,24 +238,9 @@ class SyncProject extends Command | @@ -230,24 +238,9 @@ class SyncProject extends Command | ||
| 230 | * @time :2023/8/30 15:53 | 238 | * @time :2023/8/30 15:53 |
| 231 | */ | 239 | */ |
| 232 | public function saveProject($param){ | 240 | public function saveProject($param){ |
| 233 | - if(isset($param['level']) && !empty($param['level'])){ | ||
| 234 | - $param['level'] = Arr::arrToSet($param['level']); | ||
| 235 | - } | ||
| 236 | if(isset($param['channel']) && !empty($param['channel'])){ | 241 | if(isset($param['channel']) && !empty($param['channel'])){ |
| 237 | $param['channel'] = Arr::a2s($param['channel']); | 242 | $param['channel'] = Arr::a2s($param['channel']); |
| 238 | } | 243 | } |
| 239 | - if(isset($param['notice_file']) && !empty($param['notice_file'])){ | ||
| 240 | - foreach ($param['notice_file'] as &$v1) { | ||
| 241 | - $v1['url'] = basename($v1['url']); | ||
| 242 | - } | ||
| 243 | - $param['notice_file'] = Arr::a2s($param['notice_file']); | ||
| 244 | - } | ||
| 245 | - if(isset($param['confirm_file']) && !empty($param['confirm_file'])){ | ||
| 246 | - foreach ($param['confirm_file'] as &$v2) { | ||
| 247 | - $v2['url'] = basename($v2['url']); | ||
| 248 | - } | ||
| 249 | - $param['confirm_file'] = Arr::a2s($param['confirm_file']); | ||
| 250 | - } | ||
| 251 | $projectModel = new Project(); | 244 | $projectModel = new Project(); |
| 252 | return $projectModel->addReturnId($param); | 245 | return $projectModel->addReturnId($param); |
| 253 | } | 246 | } |
| @@ -274,9 +267,6 @@ class SyncProject extends Command | @@ -274,9 +267,6 @@ class SyncProject extends Command | ||
| 274 | protected function savePayment($param,$id){ | 267 | protected function savePayment($param,$id){ |
| 275 | $param['project_id'] = $id; | 268 | $param['project_id'] = $id; |
| 276 | $paymentModel= new Payment(); | 269 | $paymentModel= new Payment(); |
| 277 | - if(isset($param['renewal_record']) && !empty($param['renewal_record'])){ | ||
| 278 | - $param['renewal_record'] = Arr::a2s($param['renewal_record']); | ||
| 279 | - } | ||
| 280 | if(isset($param['contract']) && !empty($param['contract'])){ | 270 | if(isset($param['contract']) && !empty($param['contract'])){ |
| 281 | $param['contract'] = Arr::a2s($param['contract']); | 271 | $param['contract'] = Arr::a2s($param['contract']); |
| 282 | } | 272 | } |
| @@ -311,13 +301,63 @@ class SyncProject extends Command | @@ -311,13 +301,63 @@ class SyncProject extends Command | ||
| 311 | */ | 301 | */ |
| 312 | protected function saveDeployOptimize($param,$id){ | 302 | protected function saveDeployOptimize($param,$id){ |
| 313 | $param['project_id'] = $id; | 303 | $param['project_id'] = $id; |
| 314 | - if(isset($param['minor_languages']) && !empty($param['minor_languages'])){ | ||
| 315 | - $param['minor_languages'] = Arr::a2s($param['minor_languages']); | ||
| 316 | - } | ||
| 317 | - if(isset($param['minor_keywords']) && !empty($param['minor_keywords'])){ | ||
| 318 | - $param['minor_keywords'] = Arr::a2s($param['minor_keywords']); | ||
| 319 | - } | ||
| 320 | $deployOptimizeModel = new DeployOptimize(); | 304 | $deployOptimizeModel = new DeployOptimize(); |
| 321 | return $deployOptimizeModel->add($param); | 305 | return $deployOptimizeModel->add($param); |
| 322 | } | 306 | } |
| 307 | + | ||
| 308 | + /** | ||
| 309 | + * 同步到AICC | ||
| 310 | + * @param $data | ||
| 311 | + * @author zbj | ||
| 312 | + * @date 2023/9/1 | ||
| 313 | + */ | ||
| 314 | + protected function toAicc($data){ | ||
| 315 | + $url = 'https://biz.ai.cc/api/sync_company_for_order'; | ||
| 316 | + $param = [ | ||
| 317 | + 'company_name' => $data['company_name'], | ||
| 318 | + 'company_address' => '', | ||
| 319 | + 'company_tel' => $data['principal_mobile'], | ||
| 320 | + 'company_email' => '', | ||
| 321 | + 'remark' => $data['remark'], | ||
| 322 | + 'level_id' => 6, | ||
| 323 | + 'level_day' => $data['exclusive_aicc_day'] ?: 1, | ||
| 324 | + 'from_order_id' => $data['from_order_id'], | ||
| 325 | + ]; | ||
| 326 | + | ||
| 327 | + //sign | ||
| 328 | + ksort($param); | ||
| 329 | + $tem = []; | ||
| 330 | + foreach ($param as $key => $val) { | ||
| 331 | + $tem[] = $key . '=' . urlencode($val); | ||
| 332 | + } | ||
| 333 | + $string = implode('&', $tem); | ||
| 334 | + $key = md5('quanqiusou.com'); | ||
| 335 | + $param['sign'] = md5($string . $key); | ||
| 336 | + $res = Http::withoutVerifying()->post($url, $param)->json(); | ||
| 337 | + if(empty($res['status']) || $res['status'] != 200){ | ||
| 338 | + LogUtils::error('ProjectToAicc error', $res); | ||
| 339 | + } | ||
| 340 | + } | ||
| 341 | + | ||
| 342 | + /** | ||
| 343 | + * 同步到Hagro | ||
| 344 | + * @param $data | ||
| 345 | + * @author zbj | ||
| 346 | + * @date 2023/9/1 | ||
| 347 | + */ | ||
| 348 | + protected function toHagro($data){ | ||
| 349 | + $url = 'https://beta.hagro.cn/globalso/create_project'; | ||
| 350 | + $param = [ | ||
| 351 | + 'company' => $data['company_name'], | ||
| 352 | + 'phone' => $data['principal_mobile'], | ||
| 353 | + 'planday' => $data['exclusive_aicc_day'] ?: 1, | ||
| 354 | + 'from_order_id' => $data['from_order_id'], | ||
| 355 | + ]; | ||
| 356 | + $common = new Common(); | ||
| 357 | + $token = $common->encrypt($param); | ||
| 358 | + $res = Http::withoutVerifying()->get($url, ['token' => $token])->json(); | ||
| 359 | + if(empty($res['code']) || $res['code'] != 200){ | ||
| 360 | + LogUtils::error('ProjectToHagro error', $res); | ||
| 361 | + } | ||
| 362 | + } | ||
| 323 | } | 363 | } |
| @@ -20,7 +20,7 @@ class Kernel extends ConsoleKernel | @@ -20,7 +20,7 @@ class Kernel extends ConsoleKernel | ||
| 20 | $schedule->command('rank_data_speed')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据-测速数据,每周一凌晨执行一次 | 20 | $schedule->command('rank_data_speed')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据-测速数据,每周一凌晨执行一次 |
| 21 | $schedule->command('rank_data_external_links')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据-外链,每周一凌晨执行一次 | 21 | $schedule->command('rank_data_external_links')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据-外链,每周一凌晨执行一次 |
| 22 | $schedule->command('rank_data_indexed_pages')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据-页面收录,每周一凌晨执行一次 | 22 | $schedule->command('rank_data_indexed_pages')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据-页面收录,每周一凌晨执行一次 |
| 23 | -// $schedule->command('rank_data_recomm_domain')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据-引荐域名,每周一凌晨执行一次 | 23 | + $schedule->command('rank_data_recomm_domain')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据-引荐域名,每周一凌晨执行一次 |
| 24 | $schedule->command('rank_data_week')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据,每周一凌晨执行一次 | 24 | $schedule->command('rank_data_week')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据,每周一凌晨执行一次 |
| 25 | $schedule->command('share_user')->dailyAt('01:00')->withoutOverlapping(1); // 清除用户ayr_share数据,每天凌晨1点执行一次 | 25 | $schedule->command('share_user')->dailyAt('01:00')->withoutOverlapping(1); // 清除用户ayr_share数据,每天凌晨1点执行一次 |
| 26 | $schedule->command('count')->dailyAt('01:00')->withoutOverlapping(1); // 清除用户ayr_share数据,每天凌晨1点执行一次 | 26 | $schedule->command('count')->dailyAt('01:00')->withoutOverlapping(1); // 清除用户ayr_share数据,每天凌晨1点执行一次 |
| @@ -437,7 +437,7 @@ if (!function_exists('getImageUrl')) { | @@ -437,7 +437,7 @@ if (!function_exists('getImageUrl')) { | ||
| 437 | $cosCdn = $cos['cdn']; | 437 | $cosCdn = $cos['cdn']; |
| 438 | $url = $cosCdn.$info['path']; | 438 | $url = $cosCdn.$info['path']; |
| 439 | }else{ | 439 | }else{ |
| 440 | - $url = url('upload'.$info['path']); | 440 | + $url = url($info['path']); |
| 441 | } | 441 | } |
| 442 | }else{ | 442 | }else{ |
| 443 | $url = $hash; | 443 | $url = $hash; |
| @@ -470,7 +470,7 @@ if (!function_exists('getFileUrl')) { | @@ -470,7 +470,7 @@ if (!function_exists('getFileUrl')) { | ||
| 470 | if($info['is_cos'] == 1){ | 470 | if($info['is_cos'] == 1){ |
| 471 | $cos = config('filesystems.disks.cos'); | 471 | $cos = config('filesystems.disks.cos'); |
| 472 | $cosCdn = $cos['cdn']; | 472 | $cosCdn = $cos['cdn']; |
| 473 | - $url = $cosCdn.$info['path']; | 473 | + $url = $cosCdn.'/upload'.$info['path']; |
| 474 | }else{ | 474 | }else{ |
| 475 | $url = url('upload'.$info['path']); | 475 | $url = url('upload'.$info['path']); |
| 476 | } | 476 | } |
| @@ -526,7 +526,7 @@ if (!function_exists('str_replace_url')) { | @@ -526,7 +526,7 @@ if (!function_exists('str_replace_url')) { | ||
| 526 | $urlParts = parse_url($url); | 526 | $urlParts = parse_url($url); |
| 527 | // 检查是否存在 host(域名)部分 | 527 | // 检查是否存在 host(域名)部分 |
| 528 | if (isset($urlParts['path'])) { | 528 | if (isset($urlParts['path'])) { |
| 529 | - $urlWithoutDomain = str_replace('/upload', '', $urlParts['path']); | 529 | + $urlWithoutDomain = $urlParts['path']; |
| 530 | return $urlWithoutDomain; | 530 | return $urlWithoutDomain; |
| 531 | } else { | 531 | } else { |
| 532 | return $url; | 532 | return $url; |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :UpdateController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2023/8/19 9:08 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Aside\Com; | ||
| 11 | + | ||
| 12 | +use App\Helper\Common; | ||
| 13 | +use App\Http\Controllers\Bside\BaseController; | ||
| 14 | +use App\Services\ProjectServer; | ||
| 15 | +use Illuminate\Support\Facades\DB; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * @remark :b端网站更新相关 | ||
| 19 | + * @name :UpdateController | ||
| 20 | + * @author :lyh | ||
| 21 | + * @method :post | ||
| 22 | + * @time :2023/8/19 9:08 | ||
| 23 | + */ | ||
| 24 | +class UpdateController extends BaseController | ||
| 25 | +{ | ||
| 26 | + /** | ||
| 27 | + * @remark :一键更新所有tdk | ||
| 28 | + * @name :updateSeoTdk | ||
| 29 | + * @author :lyh | ||
| 30 | + * @method :post | ||
| 31 | + * @time :2023/8/19 9:25 | ||
| 32 | + */ | ||
| 33 | + public function updateSeoTdk(){ | ||
| 34 | + $this->request->validate([ | ||
| 35 | + 'project_id'=>'required', | ||
| 36 | + ],[ | ||
| 37 | + 'project_id.required' => 'project_id不能为空', | ||
| 38 | + ]); | ||
| 39 | + ProjectServer::useProject($this->param['project_id']); | ||
| 40 | + $this->updateProduct($this->param['project_id']); | ||
| 41 | + $this->updateBlogs($this->param['project_id']); | ||
| 42 | + $this->updateNews($this->param['project_id']); | ||
| 43 | + DB::disconnect('custom_mysql'); | ||
| 44 | + $this->response('success'); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * @remark :更新产品tdk | ||
| 49 | + * @name :updateProduct | ||
| 50 | + * @author :lyh | ||
| 51 | + * @method :post | ||
| 52 | + * @time :2023/8/19 9:25 | ||
| 53 | + */ | ||
| 54 | + public function updateProduct($project_id){ | ||
| 55 | + $list = DB::connection('custom_mysql')->table('gl_product')->where(['status'=>1,'project_id'=>$project_id])->get()->toArray(); | ||
| 56 | + if(!empty($list)){ | ||
| 57 | + foreach ($list as $v){ | ||
| 58 | + if(!empty($v['seo_mate'])){ | ||
| 59 | + $seo_arr = $v['seo_mate']; | ||
| 60 | + //更新seo_title | ||
| 61 | + if(!isset($seo_arr['title'])){ | ||
| 62 | + //生成seo_title | ||
| 63 | + $seo_arr['title'] = $this->ai_send('product_seo_title',$v['title']); | ||
| 64 | + } | ||
| 65 | + //更新seo_keyword | ||
| 66 | + if(!isset($seo_arr['keyword'])){ | ||
| 67 | + $seo_arr['keyword'] = $this->ai_send('product_seo_keyword',$v['title']); | ||
| 68 | + } | ||
| 69 | + //更新seo_keyword | ||
| 70 | + if(!isset($seo_arr['description'])){ | ||
| 71 | + $seo_arr['description'] = $this->ai_send('product_seo_description',$v['title']); | ||
| 72 | + } | ||
| 73 | + $ser_str = json_encode($seo_arr,true); | ||
| 74 | + DB::connection('custom_mysql')->table('gl_product')->where(['id'=>$v['id']])->update(['seo_mate'=>$ser_str]); | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + return true; | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + /** | ||
| 82 | + * @remark :更新新闻Tdk | ||
| 83 | + * @name :updateNews | ||
| 84 | + * @author :lyh | ||
| 85 | + * @method :post | ||
| 86 | + * @time :2023/8/19 10:06 | ||
| 87 | + */ | ||
| 88 | + public function updateNews($project_id){ | ||
| 89 | + $list = DB::connection('custom_mysql')->table('gl_news')->where(['status'=>1,'project_id'=>$project_id])->get()->toArray(); | ||
| 90 | + if(!empty($list)){ | ||
| 91 | + foreach ($list as $k => $v){ | ||
| 92 | + $data = []; | ||
| 93 | + if(empty($v['seo_title'])){ | ||
| 94 | + $data['seo_title'] = $this->ai_send('news_seo_title',$v['name']); | ||
| 95 | + } | ||
| 96 | + if(empty($v['seo_keywords'])){ | ||
| 97 | + $data['seo_keywords'] = $this->ai_send('news_seo_keyword',$v['name']); | ||
| 98 | + } | ||
| 99 | + if(empty($v['seo_description'])){ | ||
| 100 | + $data['seo_description'] = $this->ai_send('news_seo_description',$v['name']); | ||
| 101 | + } | ||
| 102 | + DB::connection('custom_mysql')->table('gl_news')->where(['id'=>$v['id']])->update($data); | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | + return true; | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + /** | ||
| 109 | + * @remark :更新blogTdk | ||
| 110 | + * @name :updateBlogs | ||
| 111 | + * @author :lyh | ||
| 112 | + * @method :post | ||
| 113 | + * @time :2023/8/19 10:07 | ||
| 114 | + */ | ||
| 115 | + public function updateBlogs($project_id){ | ||
| 116 | + $list = DB::connection('custom_mysql')->table('gl_blog')->where(['status'=>1,'project_id'=>$project_id])->get()->toArray(); | ||
| 117 | + if(!empty($list)){ | ||
| 118 | + foreach ($list as $k => $v){ | ||
| 119 | + $data = []; | ||
| 120 | + if(empty($v['seo_title'])){ | ||
| 121 | + $data['seo_title'] = $this->ai_send('blog_seo_title',$v['name']); | ||
| 122 | + } | ||
| 123 | + if(empty($v['seo_keywords'])){ | ||
| 124 | + $data['seo_keywords'] = $this->ai_send('blog_seo_keyword',$v['name']); | ||
| 125 | + } | ||
| 126 | + if(empty($v['seo_description'])){ | ||
| 127 | + $data['seo_description'] = $this->ai_send('blog_seo_description',$v['name']); | ||
| 128 | + } | ||
| 129 | + DB::connection('custom_mysql')->table('gl_product')->where(['id'=>$v['id']])->update($data); | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + return true; | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + /** | ||
| 136 | + * @remark :AI发送 | ||
| 137 | + * @name :ai_send | ||
| 138 | + * @author :lyh | ||
| 139 | + * @method :post | ||
| 140 | + * @time :2023/8/19 10:40 | ||
| 141 | + */ | ||
| 142 | + public function ai_send($key,$keywords){ | ||
| 143 | + $chat_url = 'v2/openai_chat'; | ||
| 144 | + $param = [ | ||
| 145 | + 'key'=>$key, | ||
| 146 | + 'keywords'=>$keywords, | ||
| 147 | + ]; | ||
| 148 | + $data = Common::send_openai_msg($chat_url,$param); | ||
| 149 | + return $data['text']; | ||
| 150 | + } | ||
| 151 | +} |
| @@ -104,8 +104,10 @@ class ManageController extends BaseController | @@ -104,8 +104,10 @@ class ManageController extends BaseController | ||
| 104 | public function setSort(ManageLogic $logic){ | 104 | public function setSort(ManageLogic $logic){ |
| 105 | $this->request->validate([ | 105 | $this->request->validate([ |
| 106 | 'id'=>'required', | 106 | 'id'=>'required', |
| 107 | + 'sort'=>'required', | ||
| 107 | ],[ | 108 | ],[ |
| 108 | 'id.required' => 'ID不能为空', | 109 | 'id.required' => 'ID不能为空', |
| 110 | + 'sort.required' => 'sort不能为空', | ||
| 109 | ]); | 111 | ]); |
| 110 | $logic->setParamStatus(); | 112 | $logic->setParamStatus(); |
| 111 | $this->response('success'); | 113 | $this->response('success'); |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :KeywordsController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2023/9/4 10:12 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Aside\Optimize; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Controllers\Aside\BaseController; | ||
| 14 | +use App\Models\Project\DeployOptimize; | ||
| 15 | +use App\Models\Project\Project; | ||
| 16 | + | ||
| 17 | +class KeywordsController extends BaseController | ||
| 18 | +{ | ||
| 19 | + /** | ||
| 20 | + * @remark :关键字查案例 | ||
| 21 | + * @name :lists | ||
| 22 | + * @author :lyh | ||
| 23 | + * @method :post | ||
| 24 | + * @time :2023/9/4 10:13 | ||
| 25 | + */ | ||
| 26 | + public function lists(){ | ||
| 27 | + $projectDeployOptimizeModel = new DeployOptimize(); | ||
| 28 | + $ids = $projectDeployOptimizeModel->where('customer_keywords','like','%'.$this->map['search'].'%') | ||
| 29 | + ->orWhere('main_keywords', 'like' , '%'.$this->map['search'].'%')->pluck('project_id')->toArray(); | ||
| 30 | + $projectModel = new Project(); | ||
| 31 | + $lists = $projectModel->formatQuery(['id'=>['in',$ids]])->with('payment')->with('deploy_build') | ||
| 32 | + ->with('deploy_optimize')->get()->toArray(); | ||
| 33 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 34 | + } | ||
| 35 | +} |
| @@ -41,8 +41,10 @@ class TaskController extends BaseController | @@ -41,8 +41,10 @@ class TaskController extends BaseController | ||
| 41 | $lists = []; | 41 | $lists = []; |
| 42 | //获取所有人员 | 42 | //获取所有人员 |
| 43 | $taskOwnerModel = new TaskOwner(); | 43 | $taskOwnerModel = new TaskOwner(); |
| 44 | - $manager_list = $taskOwnerModel->select('manage_id', DB::raw('COUNT(*) as count')) | 44 | + $map = $this->searchParam($task,$taskOwnerModel); |
| 45 | + $manager_list = $taskOwnerModel->formatQuery($map)->select('manage_id', DB::raw('COUNT(*) as count')) | ||
| 45 | ->groupBy('manage_id')->get()->toArray(); | 46 | ->groupBy('manage_id')->get()->toArray(); |
| 47 | + | ||
| 46 | $managerModel = new Manage(); | 48 | $managerModel = new Manage(); |
| 47 | foreach ($manager_list as $k => $v){ | 49 | foreach ($manager_list as $k => $v){ |
| 48 | $ids = $taskOwnerModel->where('manage_id', $v['manage_id'])->pluck('task_id')->toArray(); | 50 | $ids = $taskOwnerModel->where('manage_id', $v['manage_id'])->pluck('task_id')->toArray(); |
| @@ -55,6 +57,47 @@ class TaskController extends BaseController | @@ -55,6 +57,47 @@ class TaskController extends BaseController | ||
| 55 | } | 57 | } |
| 56 | 58 | ||
| 57 | /** | 59 | /** |
| 60 | + * @remark : | ||
| 61 | + * @name :searchParam | ||
| 62 | + * @author :lyh | ||
| 63 | + * @method :post | ||
| 64 | + * @time :2023/9/1 15:37 | ||
| 65 | + */ | ||
| 66 | + public function searchParam(&$task,&$taskOwnerModel){ | ||
| 67 | + $map = []; | ||
| 68 | + if(isset($this->map['type']) && !empty($this->map['type'])){ | ||
| 69 | + if(isset($this->map['manage_id']) && !empty($this->map['manage_id'])){ | ||
| 70 | + if($this->map['type'] == 1){ | ||
| 71 | + $ids = $task->where('created_manage_id', $this->map['manage_id'])->pluck('id')->toArray(); | ||
| 72 | + $manage_ids = $taskOwnerModel->formatQuery(['task_id'=>['in',$ids]])->pluck('manage_id')->toArray(); | ||
| 73 | + $map['manage_id'] = ['in',$manage_ids]; | ||
| 74 | + }else{ | ||
| 75 | + $map['manage_id'] = $this->map['manage_id']; | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + }elseif (isset($this->map['search_type']) && !empty($this->map['search_type'])){ | ||
| 79 | + if(isset($this->map['search']) && !empty($this->map['search'])) { | ||
| 80 | + $projectModel = new Project(); | ||
| 81 | + if($this->map['search_type'] == 'project'){ | ||
| 82 | + $ids = $projectModel->where('title', 'like', '%' . $this->map['search'] . '%')->pluck('id')->toArray(); | ||
| 83 | + $manage_ids = $taskOwnerModel->formatQuery(['project'=>['in',$ids]])->pluck('manage_id')->toArray(); | ||
| 84 | + $map['manage_id'] = ['in',$manage_ids]; | ||
| 85 | + }else{ | ||
| 86 | + $ids = $task->where('content', 'like','%'.$this->map['search'].'%')->pluck('id')->toArray(); | ||
| 87 | + $manage_ids = $taskOwnerModel->formatQuery(['task_id'=>['in',$ids]])->pluck('manage_id')->toArray(); | ||
| 88 | + $map['manage_id'] = ['in',$manage_ids]; | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + }else{ | ||
| 92 | + if(isset($this->map['search_type']) && !empty($this->map['search_type'])){ | ||
| 93 | + $map['manage_id'] = $this->map['manage_id']; | ||
| 94 | + } | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + return $map; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + /** | ||
| 58 | * @remark :获取详情 | 101 | * @remark :获取详情 |
| 59 | * @name :info | 102 | * @name :info |
| 60 | * @author :lyh | 103 | * @author :lyh |
| @@ -162,4 +205,29 @@ class TaskController extends BaseController | @@ -162,4 +205,29 @@ class TaskController extends BaseController | ||
| 162 | } | 205 | } |
| 163 | return $v; | 206 | return $v; |
| 164 | } | 207 | } |
| 208 | + | ||
| 209 | + /** | ||
| 210 | + * @remark :获取我的任务列表 | ||
| 211 | + * @name :getUserTaskList | ||
| 212 | + * @author :lyh | ||
| 213 | + * @method :post | ||
| 214 | + * @time :2023/9/4 9:14 | ||
| 215 | + */ | ||
| 216 | + public function getUserTaskList(){ | ||
| 217 | + $taskOwnerModel = new TaskOwner(); | ||
| 218 | + $this->map['manage_id'] = $this->manage['id']; | ||
| 219 | + $lists = $taskOwnerModel->lists($this->map,$this->page,$this->row,$this->order); | ||
| 220 | + if(!empty($lists) && !empty($lists['list'])){ | ||
| 221 | + $taskModel = new Task(); | ||
| 222 | + $managerModel = new Manage(); | ||
| 223 | + foreach ($lists['list'] as $k => $v){ | ||
| 224 | + $taskInfo = $taskModel->read(['id'=>$v['task_id']]); | ||
| 225 | + $taskInfo = $this->getFileUrl($taskInfo); | ||
| 226 | + $v["manage_id_text"] = $managerModel->getName($v['manage_id']); | ||
| 227 | + $v['task_info'] = $taskInfo; | ||
| 228 | + $lists['list'][$k] = $v; | ||
| 229 | + } | ||
| 230 | + } | ||
| 231 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 232 | + } | ||
| 165 | } | 233 | } |
| @@ -30,7 +30,8 @@ class ProjectMenuController extends BaseController | @@ -30,7 +30,8 @@ class ProjectMenuController extends BaseController | ||
| 30 | * @time :2023/6/21 17:24 | 30 | * @time :2023/6/21 17:24 |
| 31 | */ | 31 | */ |
| 32 | public function lists(ProjectMenuLogic $projectMenuLogic){ | 32 | public function lists(ProjectMenuLogic $projectMenuLogic){ |
| 33 | - $lists = $projectMenuLogic->MenuList($this->map); | 33 | + $this->order = 'sort'; |
| 34 | + $lists = $projectMenuLogic->MenuList($this->map,$this->order); | ||
| 34 | $this->response('success',Code::SUCCESS,$lists); | 35 | $this->response('success',Code::SUCCESS,$lists); |
| 35 | } | 36 | } |
| 36 | 37 | ||
| @@ -137,4 +138,21 @@ class ProjectMenuController extends BaseController | @@ -137,4 +138,21 @@ class ProjectMenuController extends BaseController | ||
| 137 | $list = $projectMenuLogic->roleMenuInfo(); | 138 | $list = $projectMenuLogic->roleMenuInfo(); |
| 138 | $this->response('success',Code::SUCCESS,$list); | 139 | $this->response('success',Code::SUCCESS,$list); |
| 139 | } | 140 | } |
| 141 | + | ||
| 142 | + /** | ||
| 143 | + * @remark :排序 | ||
| 144 | + * @name :setSort | ||
| 145 | + * @author :lyh | ||
| 146 | + * @method :post | ||
| 147 | + * @time :2023/8/10 16:40 | ||
| 148 | + */ | ||
| 149 | + public function sort(ProjectMenuLogic $projectMenuLogic){ | ||
| 150 | + $this->request->validate([ | ||
| 151 | + 'id'=>'required', | ||
| 152 | + ],[ | ||
| 153 | + 'id.required' => 'ID不能为空', | ||
| 154 | + ]); | ||
| 155 | + $projectMenuLogic->setParamStatus(); | ||
| 156 | + $this->response('success'); | ||
| 157 | + } | ||
| 140 | } | 158 | } |
| @@ -145,4 +145,21 @@ class ProjectUserController extends BaseController | @@ -145,4 +145,21 @@ class ProjectUserController extends BaseController | ||
| 145 | $list = $roleModel->list($this->map); | 145 | $list = $roleModel->list($this->map); |
| 146 | $this->response('success',Code::SUCCESS,$list); | 146 | $this->response('success',Code::SUCCESS,$list); |
| 147 | } | 147 | } |
| 148 | + | ||
| 149 | + /** | ||
| 150 | + * @remark :排序 | ||
| 151 | + * @name :setSort | ||
| 152 | + * @author :lyh | ||
| 153 | + * @method :post | ||
| 154 | + * @time :2023/8/10 16:40 | ||
| 155 | + */ | ||
| 156 | + public function sort(UserLogic $userLogic){ | ||
| 157 | + $this->request->validate([ | ||
| 158 | + 'id'=>'required', | ||
| 159 | + ],[ | ||
| 160 | + 'id.required' => 'ID不能为空', | ||
| 161 | + ]); | ||
| 162 | + $userLogic->setParamStatus(); | ||
| 163 | + $this->response('success'); | ||
| 164 | + } | ||
| 148 | } | 165 | } |
| @@ -9,6 +9,7 @@ use App\Http\Logic\Bside\User\UserLogic; | @@ -9,6 +9,7 @@ use App\Http\Logic\Bside\User\UserLogic; | ||
| 9 | use App\Models\Project\Project; | 9 | use App\Models\Project\Project; |
| 10 | use App\Models\User\ProjectMenu as ProjectMenuModel; | 10 | use App\Models\User\ProjectMenu as ProjectMenuModel; |
| 11 | use App\Models\User\ProjectRole as ProjectRoleModel; | 11 | use App\Models\User\ProjectRole as ProjectRoleModel; |
| 12 | +use App\Models\User\User; | ||
| 12 | use Illuminate\Support\Facades\Cache; | 13 | use Illuminate\Support\Facades\Cache; |
| 13 | 14 | ||
| 14 | /*** | 15 | /*** |
| @@ -72,7 +73,7 @@ class ComController extends BaseController | @@ -72,7 +73,7 @@ class ComController extends BaseController | ||
| 72 | ]); | 73 | ]); |
| 73 | $userLogic = new UserLogic(); | 74 | $userLogic = new UserLogic(); |
| 74 | $this->param['id'] = $this->uid; | 75 | $this->param['id'] = $this->uid; |
| 75 | - $userLogic->edits($this->param); | 76 | + $userLogic->edits(); |
| 76 | $this->response('编辑成功'); | 77 | $this->response('编辑成功'); |
| 77 | } | 78 | } |
| 78 | 79 | ||
| @@ -92,6 +93,22 @@ class ComController extends BaseController | @@ -92,6 +93,22 @@ class ComController extends BaseController | ||
| 92 | } | 93 | } |
| 93 | 94 | ||
| 94 | /** | 95 | /** |
| 96 | + * @remark :微信解绑 | ||
| 97 | + * @name :unbindWechat | ||
| 98 | + * @author :lyh | ||
| 99 | + * @method :post | ||
| 100 | + * @time :2023/9/1 16:47 | ||
| 101 | + */ | ||
| 102 | + public function unbindWechat(){ | ||
| 103 | + $userModel = new User(); | ||
| 104 | + $rs = $userModel->edit(['wechat'=>''],['id'=>$this->user['id']]); | ||
| 105 | + if($rs === false){ | ||
| 106 | + $this->response('error',Code::USER_ERROR); | ||
| 107 | + } | ||
| 108 | + $this->response('success'); | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + /** | ||
| 95 | * @remark :生成token | 112 | * @remark :生成token |
| 96 | * @name :generateToken | 113 | * @name :generateToken |
| 97 | * @author :lyh | 114 | * @author :lyh |
| @@ -101,7 +118,7 @@ class ComController extends BaseController | @@ -101,7 +118,7 @@ class ComController extends BaseController | ||
| 101 | public function generateToken(){ | 118 | public function generateToken(){ |
| 102 | $data = [ | 119 | $data = [ |
| 103 | 'phone' => $this->user['mobile'], | 120 | 'phone' => $this->user['mobile'], |
| 104 | - 'from_order_id' => $this->param['from_order_id'] ?? '5a179274si3j8z', // 提单系统 同步到个项目的唯一凭证(数字或者字符串) | 121 | + 'from_order_id' => $this->user['from_order_id'] ?? '5a179274si3j8z', // 提单系统 同步到个项目的唯一凭证(数字或者字符串) |
| 105 | 'timestamp' => time(), // 接收到字符串解密出来以后需要 验证时间不超过30秒 超过时间视为无效授权 | 122 | 'timestamp' => time(), // 接收到字符串解密出来以后需要 验证时间不超过30秒 超过时间视为无效授权 |
| 106 | ]; | 123 | ]; |
| 107 | $common = new Common(); | 124 | $common = new Common(); |
| @@ -27,7 +27,7 @@ class MonthCountController extends BaseController | @@ -27,7 +27,7 @@ class MonthCountController extends BaseController | ||
| 27 | * @time :2023/6/30 17:58 | 27 | * @time :2023/6/30 17:58 |
| 28 | */ | 28 | */ |
| 29 | public function lists(MonthCountLogic $monthCountLogic){ | 29 | public function lists(MonthCountLogic $monthCountLogic){ |
| 30 | - $lists = $monthCountLogic->getCountLists($this->map,$this->page,$this->row = 10,$this->order); | 30 | + $lists = $monthCountLogic->getCountLists($this->map,$this->order); |
| 31 | $this->response('success',Code::SUCCESS,$lists); | 31 | $this->response('success',Code::SUCCESS,$lists); |
| 32 | } | 32 | } |
| 33 | 33 |
| @@ -12,20 +12,23 @@ namespace App\Http\Controllers\Bside; | @@ -12,20 +12,23 @@ namespace App\Http\Controllers\Bside; | ||
| 12 | use App\Enums\Common\Code; | 12 | use App\Enums\Common\Code; |
| 13 | use App\Events\WebSocketMessage; | 13 | use App\Events\WebSocketMessage; |
| 14 | use App\Events\WebSocketMessageSent; | 14 | use App\Events\WebSocketMessageSent; |
| 15 | -use App\Helper\Arr; | ||
| 16 | use App\Helper\Common; | 15 | use App\Helper\Common; |
| 17 | -use App\Helper\Socket; | ||
| 18 | use App\Helper\Translate; | 16 | use App\Helper\Translate; |
| 19 | use App\Helper\Wechat; | 17 | use App\Helper\Wechat; |
| 18 | +use App\Http\Logic\Bside\User\UserLogic; | ||
| 20 | use App\Http\Logic\Bside\User\UserLoginLogic; | 19 | use App\Http\Logic\Bside\User\UserLoginLogic; |
| 21 | -use App\Models\File\Image; | 20 | +use App\Models\File\Image as ImageModel; |
| 22 | use App\Models\Project\Project; | 21 | use App\Models\Project\Project; |
| 23 | use App\Models\Service\Service; | 22 | use App\Models\Service\Service; |
| 24 | use App\Models\Sms\SmsLog; | 23 | use App\Models\Sms\SmsLog; |
| 25 | use App\Models\Template\Template; | 24 | use App\Models\Template\Template; |
| 26 | use App\Models\Template\TemplateModule; | 25 | use App\Models\Template\TemplateModule; |
| 26 | +use App\Models\User\DeptUser; | ||
| 27 | +use App\Models\User\ProjectRole; | ||
| 28 | +use App\Models\User\User; | ||
| 27 | use App\Models\User\User as UserModel; | 29 | use App\Models\User\User as UserModel; |
| 28 | use App\Utils\EncryptUtils; | 30 | use App\Utils\EncryptUtils; |
| 31 | +use Illuminate\Database\Eloquent\Model; | ||
| 29 | use \Illuminate\Support\Facades\Cache; | 32 | use \Illuminate\Support\Facades\Cache; |
| 30 | use Mrgoon\AliSms\AliSms; | 33 | use Mrgoon\AliSms\AliSms; |
| 31 | 34 | ||
| @@ -152,9 +155,17 @@ class LoginController extends BaseController | @@ -152,9 +155,17 @@ class LoginController extends BaseController | ||
| 152 | * @time :2023/8/23 18:46 | 155 | * @time :2023/8/23 18:46 |
| 153 | */ | 156 | */ |
| 154 | public function qrcode(){ | 157 | public function qrcode(){ |
| 158 | + $this->request->validate([ | ||
| 159 | + 'type' => 'required', | ||
| 160 | + ],[ | ||
| 161 | + 'type.required' => '请选择项目', | ||
| 162 | + ]); | ||
| 163 | + if(!isset($this->param['id'])){ | ||
| 164 | + $this->param['id'] = 0; | ||
| 165 | + } | ||
| 155 | $wechat = new Wechat(); | 166 | $wechat = new Wechat(); |
| 156 | $accessToken = $wechat->getAccessToken(); | 167 | $accessToken = $wechat->getAccessToken(); |
| 157 | - $data = $wechat->setQrcode('global-v6',$accessToken); | 168 | + $data = $wechat->setQrcode('global-v6_'.$this->param['type'].'_'.$this->param['id'],$accessToken); |
| 158 | if(!empty($data)){ | 169 | if(!empty($data)){ |
| 159 | $data['url'] = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=".$data['ticket']; | 170 | $data['url'] = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=".$data['ticket']; |
| 160 | } | 171 | } |
| @@ -171,27 +182,44 @@ class LoginController extends BaseController | @@ -171,27 +182,44 @@ class LoginController extends BaseController | ||
| 171 | public function eventMessage(){ | 182 | public function eventMessage(){ |
| 172 | $message = file_get_contents("php://input"); | 183 | $message = file_get_contents("php://input"); |
| 173 | $message = simplexml_load_string($message, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOERROR); | 184 | $message = simplexml_load_string($message, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOERROR); |
| 174 | - $data = $this->wechatLogin($message->FromUserName); | ||
| 175 | - $socket = new Socket(); | ||
| 176 | - $socket->socket(json_encode($data)); | ||
| 177 | - $arr = [ | ||
| 178 | - 'ToUserName' => 'gh_27174ac5c9d8', | ||
| 179 | - 'FromUserName' => 'oMbcI6gRzvfrU8ssGsEyvzXOO94w', | ||
| 180 | - 'CreateTime' => '1693385898', | ||
| 181 | - 'MsgType' => 'event', | ||
| 182 | - 'Event' => 'subscribe', | ||
| 183 | - 'EventKey' => 'qrscene_global-v6_v6', | ||
| 184 | - 'Ticket' => 'gQF27zwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyWnppdHhWTlRjOEcxTlBpTE5BY2IAAgRjBO9kAwQQDgAA', | ||
| 185 | - ]; | 185 | + $jsonData = json_encode($message); |
| 186 | + $arrayData = json_decode($jsonData, true); | ||
| 187 | + $data = $this->setWechat($arrayData['ToUserName'],$arrayData['EventKey']); | ||
| 188 | + if($data['code'] == 0){//登录失败,请先绑定 | ||
| 189 | + $resMessage = $data['message']; | ||
| 190 | + }elseif($data['code'] == 1){ | ||
| 191 | + $resMessage = $data['message']; | ||
| 192 | + }elseif($data['code'] == 2){ | ||
| 193 | + $resMessage = $data['message']; | ||
| 194 | + }else{ | ||
| 195 | + $resMessage = $data['message']; | ||
| 196 | + } | ||
| 197 | + Cache::add($arrayData['Ticket'],$data,300); | ||
| 186 | return "<xml> | 198 | return "<xml> |
| 187 | <ToUserName><![CDATA[$message->FromUserName]]></ToUserName> | 199 | <ToUserName><![CDATA[$message->FromUserName]]></ToUserName> |
| 188 | <FromUserName><![CDATA[$message->ToUserName]]></FromUserName> | 200 | <FromUserName><![CDATA[$message->ToUserName]]></FromUserName> |
| 189 | <CreateTime>".time()."</CreateTime> | 201 | <CreateTime>".time()."</CreateTime> |
| 190 | <MsgType><![CDATA[text]]></MsgType> | 202 | <MsgType><![CDATA[text]]></MsgType> |
| 191 | - <Content><![CDATA[扫码成功了]]></Content> | 203 | + <Content><![CDATA[$resMessage]]></Content> |
| 192 | </xml>"; | 204 | </xml>"; |
| 193 | } | 205 | } |
| 194 | 206 | ||
| 207 | + /** | ||
| 208 | + * @remark :登录成功响应 | ||
| 209 | + * @name :getWechatLoginInfo | ||
| 210 | + * @author :lyh | ||
| 211 | + * @method :post | ||
| 212 | + * @time :2023/9/1 10:12 | ||
| 213 | + */ | ||
| 214 | + public function getWechatLoginInfo(){ | ||
| 215 | + $this->request->validate([ | ||
| 216 | + 'ticket' => 'required', | ||
| 217 | + ],[ | ||
| 218 | + 'ticket.required' => 'ticket不能为空', | ||
| 219 | + ]); | ||
| 220 | + $info = Cache::get($this->param['ticket']); | ||
| 221 | + $this->response('success',Code::SUCCESS,$info); | ||
| 222 | + } | ||
| 195 | 223 | ||
| 196 | /** | 224 | /** |
| 197 | * @remark :解token | 225 | * @remark :解token |
| @@ -202,19 +230,45 @@ class LoginController extends BaseController | @@ -202,19 +230,45 @@ class LoginController extends BaseController | ||
| 202 | */ | 230 | */ |
| 203 | public function globalSo_v6_login(UserLoginLogic $logic){ | 231 | public function globalSo_v6_login(UserLoginLogic $logic){ |
| 204 | $common = new Common(); | 232 | $common = new Common(); |
| 205 | - $arr = $common->decrypt($this->param['token']); | 233 | + $arr = $common->decrypt(urldecode($this->param['token'])); |
| 206 | if(empty($arr)){ | 234 | if(empty($arr)){ |
| 207 | $this->response('登录失败',Code::USER_ERROR); | 235 | $this->response('登录失败',Code::USER_ERROR); |
| 208 | } | 236 | } |
| 209 | - $userModel = new UserModel(); | ||
| 210 | - $info = $userModel->read(['mobile'=>$arr['phone']]); | ||
| 211 | - if($info === false){ | ||
| 212 | - $this->response('当前用户不存在请联系管理员',Code::USER_ERROR); | 237 | + //没有from_order_id的项目 进入演示版 运营中心 |
| 238 | + $arr['from_order_id'] = 0; | ||
| 239 | + if(!$arr['from_order_id']){ | ||
| 240 | + //有账号就直接登录, 没有账号创建账号登录 | ||
| 241 | + $user = (new User())->where('project_id', Project::DEMO_PROJECT_ID)->where('mobile', $arr['phone'])->first(); | ||
| 242 | + if(!$user){ | ||
| 243 | + $user = new User(); | ||
| 244 | + $user->project_id = Project::DEMO_PROJECT_ID; | ||
| 245 | + $user->role_id = ProjectRole::OPERATION_CENTER_ID; | ||
| 246 | + $user->mobile = $arr['phone']; | ||
| 247 | + $user->password = base64_encode(md5('v6.' . substr($arr['phone'], -6))); | ||
| 248 | + $user->name = $arr['name'] ?? $arr['phone']; | ||
| 249 | + $user->save(); | ||
| 250 | + //运营中心组织 | ||
| 251 | + $dept_user = new DeptUser(); | ||
| 252 | + $dept_user->dept_id = DeptUser::OPERATION_CENTER_ID; | ||
| 253 | + $dept_user->project_id = Project::DEMO_PROJECT_ID; | ||
| 254 | + $dept_user->user_id = $user->id; | ||
| 255 | + $dept_user->save(); | ||
| 256 | + } | ||
| 257 | + $data = [ | ||
| 258 | + 'user_id'=>$user['id'], | ||
| 259 | + 'manager_id'=>0, | ||
| 260 | + ]; | ||
| 261 | + }else{ | ||
| 262 | + //有from_order_id, 找到对应的项目并登录主账号 | ||
| 263 | + $project = (new Project())->read(['from_order_id'=>$arr['from_order_id']]); | ||
| 264 | + if(!$project){ | ||
| 265 | + $this->response('项目不存在,请联系管理员',Code::USER_ERROR); | ||
| 213 | } | 266 | } |
| 214 | $data = [ | 267 | $data = [ |
| 215 | - 'user_id'=>$info['id'], | 268 | + 'project_id'=>$project['id'], |
| 216 | 'manager_id'=>0, | 269 | 'manager_id'=>0, |
| 217 | ]; | 270 | ]; |
| 271 | + } | ||
| 218 | $info = $logic->autologin($data); | 272 | $info = $logic->autologin($data); |
| 219 | $this->response('success',Code::SUCCESS,['info'=>$info]); | 273 | $this->response('success',Code::SUCCESS,['info'=>$info]); |
| 220 | } | 274 | } |
| @@ -226,96 +280,37 @@ class LoginController extends BaseController | @@ -226,96 +280,37 @@ class LoginController extends BaseController | ||
| 226 | * @method :post | 280 | * @method :post |
| 227 | * @time :2023/8/31 9:13 | 281 | * @time :2023/8/31 9:13 |
| 228 | */ | 282 | */ |
| 229 | - public function wechatLogin($wechat){ | ||
| 230 | - //查看当前账户是否绑定 | ||
| 231 | - $userModel = new UserModel(); | ||
| 232 | - $info = $userModel->read(['wechat'=>$wechat]); | ||
| 233 | - if($info === false){ | 283 | + public function setWechat($wechat,$eventKey){ |
| 284 | + $userLoginLogic = new UserLoginLogic(); | ||
| 285 | + $key = explode("_",$eventKey); | ||
| 286 | + if($key[1] == 'login'){ | ||
| 287 | + $data = $userLoginLogic->wechatLogin($wechat); | ||
| 288 | + }elseif($key[1] == 'bind'){ | ||
| 289 | + $data = $userLoginLogic->wechatBind($wechat,$key[2]); | ||
| 290 | + }else{ | ||
| 234 | $data = [ | 291 | $data = [ |
| 235 | - 'code'=>Code::USER_LOGIN_ERROE, | ||
| 236 | - 'message'=>'当前用户未绑定账户,请绑定后', | ||
| 237 | - ]; | ||
| 238 | - }else { | ||
| 239 | - //获取项目详情 | ||
| 240 | - $info = $this->assembleParam($info['mobile'],$info['project_id']); | ||
| 241 | - if(isset($info['token']) && !empty($info['token'])){ | ||
| 242 | - //清除上一次用户缓存 | ||
| 243 | - Cache::pull($info['token']); | ||
| 244 | - } | ||
| 245 | - //生成新token | ||
| 246 | - $token = md5(uniqid().$info['id']); | ||
| 247 | - //存储缓存 | ||
| 248 | - $info['token'] = $token; | ||
| 249 | - Cache::add($token,$info,3600); | ||
| 250 | - //更新用户信息 | ||
| 251 | - $this->model->edit(['token'=>$token],['id'=>$info['id']]); | ||
| 252 | - $data = [ | ||
| 253 | - 'code'=>Code::SUCCESS, | ||
| 254 | - 'message'=>'当前用户未绑定账户,请绑定后', | ||
| 255 | - 'data'=>$info | 292 | + 'code'=>0, |
| 293 | + 'message'=>'关注成功,请登录后绑定账号后扫码,如已绑定,请再次扫码', | ||
| 256 | ]; | 294 | ]; |
| 257 | } | 295 | } |
| 258 | return $data; | 296 | return $data; |
| 259 | } | 297 | } |
| 260 | 298 | ||
| 261 | public function ceshi(){ | 299 | public function ceshi(){ |
| 262 | - | ||
| 263 | - } | ||
| 264 | - | ||
| 265 | - public function daoru(){ | ||
| 266 | - $templateModel = new Template(); | ||
| 267 | - $list = $templateModel->list(); | ||
| 268 | - foreach ($list as $k => $v){ | ||
| 269 | - preg_match_all('/\(https:\/\/admin.item.globalso.site\/a\/image\/(.*?)\)/', $v['html'], $matches); | ||
| 270 | - if (!empty($matches[1])) { | ||
| 271 | - $srcValues = $matches[1]; | ||
| 272 | - $imageModel = new Image(); | ||
| 273 | - $html = $v['html']; | ||
| 274 | - foreach ($srcValues as $srcValue) { | ||
| 275 | - $image_info = $imageModel->read(['hash' => $srcValue]); | ||
| 276 | - if ($image_info !== false) { | ||
| 277 | - $path = $image_info['path']; | ||
| 278 | - $html = $this->re($html, '/a/image/'.$srcValue, $path); | ||
| 279 | - } | ||
| 280 | - } | ||
| 281 | - $templateModel->edit(['html'=>$html],['id'=>$v['id']]); | ||
| 282 | - } | ||
| 283 | - } | ||
| 284 | - return 1; | ||
| 285 | - } | ||
| 286 | - | ||
| 287 | - public function re(&$html,$srcValue,$path){ | ||
| 288 | - $html = str_replace( | ||
| 289 | - $srcValue, | ||
| 290 | - $path, | ||
| 291 | - $html | ||
| 292 | - ); | ||
| 293 | - return $html; | ||
| 294 | - } | ||
| 295 | - | ||
| 296 | - public function updateHtml(){ | ||
| 297 | - $html = $this->re($v['html'],'https://develop.globalso.com/a/image/','https://ecdn6.globalso.com/public/template/'); | ||
| 298 | - $html = $this->re($v['html'],'https://develop.globalso.com/b/image/','https://ecdn6.globalso.com/public/template/'); | ||
| 299 | - } | ||
| 300 | - | ||
| 301 | - public function updateCe(){ | ||
| 302 | $templateModel = new TemplateModule(); | 300 | $templateModel = new TemplateModule(); |
| 303 | - $list = []; | ||
| 304 | - foreach ($list as $k => $v){ | ||
| 305 | - preg_match_all('/\"https:\/\/develop.globalso.com\/a\/image\/(.*?)\"/', $v['html'], $matches); | ||
| 306 | - if (!empty($matches[1])) { | ||
| 307 | - $srcValues = $matches[1]; | ||
| 308 | - $imageModel = new Image(); | ||
| 309 | - $html = $v['html']; | ||
| 310 | - foreach ($srcValues as $srcValue) { | ||
| 311 | - $image_info = $imageModel->read(['hash' => $srcValue]); | ||
| 312 | - if ($image_info !== false) { | ||
| 313 | - $path = basename($image_info['path']); | ||
| 314 | - $html = $this->re($html, $srcValue, $path); | ||
| 315 | - } | 301 | + $list = $templateModel->list(); |
| 302 | + $imageModel = new ImageModel(); | ||
| 303 | + foreach ($list as $k=>$v){ | ||
| 304 | + if (strpos($v['image'], '.') !== false) { | ||
| 305 | + $v['image'] = '/upload'.$v['image']; | ||
| 306 | + }else{ | ||
| 307 | + $info = $imageModel->read(['hash'=>$v['image']]); | ||
| 308 | + if($info !== false){ | ||
| 309 | + $v['image'] = $info['path']; | ||
| 316 | } | 310 | } |
| 317 | } | 311 | } |
| 318 | - $templateModel->edit(['html'=>$html],['id'=>$v['id']]); | 312 | + $templateModel->edit(['image'=>$v['image']],['id'=>$v['id']]); |
| 319 | } | 313 | } |
| 314 | + $this->response('success'); | ||
| 320 | } | 315 | } |
| 321 | } | 316 | } |
| @@ -62,6 +62,9 @@ class RankDataController extends BaseController | @@ -62,6 +62,9 @@ class RankDataController extends BaseController | ||
| 62 | $data = $googleSpeedApi->run($domain); | 62 | $data = $googleSpeedApi->run($domain); |
| 63 | if($data){ | 63 | if($data){ |
| 64 | $model = GoogleSpeedModel::where('project_id', $project_id)->first(); | 64 | $model = GoogleSpeedModel::where('project_id', $project_id)->first(); |
| 65 | + if(!$model){ | ||
| 66 | + $model = new GoogleSpeedModel(); | ||
| 67 | + } | ||
| 65 | $model->project_id = $project_id; | 68 | $model->project_id = $project_id; |
| 66 | $model->data = $data; | 69 | $model->data = $data; |
| 67 | $model->updated_date = date('Y-m-d'); | 70 | $model->updated_date = date('Y-m-d'); |
| @@ -54,7 +54,7 @@ class UserController extends BaseController | @@ -54,7 +54,7 @@ class UserController extends BaseController | ||
| 54 | * @author :liyuhang | 54 | * @author :liyuhang |
| 55 | * @method | 55 | * @method |
| 56 | */ | 56 | */ |
| 57 | - public function edit(UserRequest $request,UserLogic $userLogic){ | 57 | + public function edit(Request $request,UserLogic $userLogic){ |
| 58 | $request->validate([ | 58 | $request->validate([ |
| 59 | 'id'=>['required'] | 59 | 'id'=>['required'] |
| 60 | ],[ | 60 | ],[ |
| @@ -23,7 +23,7 @@ class FileController | @@ -23,7 +23,7 @@ class FileController | ||
| 23 | public $token = '';//token | 23 | public $token = '';//token |
| 24 | 24 | ||
| 25 | public $cache = '';//缓存数据 | 25 | public $cache = '';//缓存数据 |
| 26 | - public $upload_location = 0; | 26 | + public $upload_location = 1; |
| 27 | public $file_type = [ | 27 | public $file_type = [ |
| 28 | 2 => 'other',//其他 | 28 | 2 => 'other',//其他 |
| 29 | 1 => 'video',//视频 | 29 | 1 => 'video',//视频 |
| @@ -222,7 +222,7 @@ class FileController | @@ -222,7 +222,7 @@ class FileController | ||
| 222 | */ | 222 | */ |
| 223 | public function downLoad(){ | 223 | public function downLoad(){ |
| 224 | $file_model = new File(); | 224 | $file_model = new File(); |
| 225 | - $info = $file_model->read(['hash' => $this->param['hash']]); | 225 | + $info = $file_model->read(['path' => $this->param['path']]); |
| 226 | if ($info === false) { | 226 | if ($info === false) { |
| 227 | $this->response('指定文件不存在!', Code::USER_ERROR); | 227 | $this->response('指定文件不存在!', Code::USER_ERROR); |
| 228 | } | 228 | } |
| @@ -265,8 +265,8 @@ class FileController | @@ -265,8 +265,8 @@ class FileController | ||
| 265 | //根据项目上传标识区分上传到cos/本地 | 265 | //根据项目上传标识区分上传到cos/本地 |
| 266 | $projectModel = new Project(); | 266 | $projectModel = new Project(); |
| 267 | $project_info = $projectModel->read(['id' => $this->cache['project_id']], ['project_location']); | 267 | $project_info = $projectModel->read(['id' => $this->cache['project_id']], ['project_location']); |
| 268 | - if ($project_info['project_location'] == 0) {//通项目时 上传到cos | ||
| 269 | - $this->upload_location = 1;//1:上传到本地 | 268 | + if ($project_info['project_location'] != 0) {//通项目时 上传到cos |
| 269 | + $this->upload_location = 0;//1:上传到本地 | ||
| 270 | } | 270 | } |
| 271 | } | 271 | } |
| 272 | $this->path = $this->uploads['path_b'].'/'.$this->cache['project_id'].'/'.$this->file_type[$this->param['refer']].'/'.date('Y-m'); | 272 | $this->path = $this->uploads['path_b'].'/'.$this->cache['project_id'].'/'.$this->file_type[$this->param['refer']].'/'.date('Y-m'); |
| @@ -314,11 +314,11 @@ class FileController | @@ -314,11 +314,11 @@ class FileController | ||
| 314 | */ | 314 | */ |
| 315 | public function getDownloadUrl(){ | 315 | public function getDownloadUrl(){ |
| 316 | $fileModel = new File(); | 316 | $fileModel = new File(); |
| 317 | - $info = $fileModel->read(['hash' => $this->param['hash']]); | 317 | + $info = $fileModel->read(['path' => $this->param['path']]); |
| 318 | if ($info === false) { | 318 | if ($info === false) { |
| 319 | $this->response('指定文件不存在!', Code::USER_ERROR); | 319 | $this->response('指定文件不存在!', Code::USER_ERROR); |
| 320 | } | 320 | } |
| 321 | - $data = ['file_download'=>url('a/downLoad/files?hash='.$this->param['hash'])]; | 321 | + $data = ['file_download'=>url('a/downLoad/files?path='.$this->param['path'])]; |
| 322 | $this->response('success',Code::SUCCESS,$data); | 322 | $this->response('success',Code::SUCCESS,$data); |
| 323 | } | 323 | } |
| 324 | } | 324 | } |
| @@ -16,7 +16,7 @@ use Intervention\Image\Facades\Image; | @@ -16,7 +16,7 @@ use Intervention\Image\Facades\Image; | ||
| 16 | 16 | ||
| 17 | class ImageController extends Controller | 17 | class ImageController extends Controller |
| 18 | { | 18 | { |
| 19 | - public $path = '';//路径 | 19 | + public $path = '/upload';//路径 |
| 20 | 20 | ||
| 21 | public $config = '';//存储默认配置 | 21 | public $config = '';//存储默认配置 |
| 22 | 22 | ||
| @@ -35,7 +35,7 @@ class ImageController extends Controller | @@ -35,7 +35,7 @@ class ImageController extends Controller | ||
| 35 | public $map = []; | 35 | public $map = []; |
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | - public $upload_location = 0;//是否同步到cos | 38 | + public $upload_location = 1;//是否同步到cos |
| 39 | //上传图片类型 | 39 | //上传图片类型 |
| 40 | public $image_type = [ | 40 | public $image_type = [ |
| 41 | 1 => 'image_product', | 41 | 1 => 'image_product', |
| @@ -291,7 +291,7 @@ class ImageController extends Controller | @@ -291,7 +291,7 @@ class ImageController extends Controller | ||
| 291 | */ | 291 | */ |
| 292 | public function download(){ | 292 | public function download(){ |
| 293 | $imageModel = new ImageModel(); | 293 | $imageModel = new ImageModel(); |
| 294 | - $info = $imageModel->read(['hash' => $this->param['hash']]); | 294 | + $info = $imageModel->read(['path' => $this->param['path']]); |
| 295 | if ($info === false) { | 295 | if ($info === false) { |
| 296 | $this->response('指定文件不存在!', Code::USER_ERROR); | 296 | $this->response('指定文件不存在!', Code::USER_ERROR); |
| 297 | } | 297 | } |
| @@ -372,8 +372,8 @@ class ImageController extends Controller | @@ -372,8 +372,8 @@ class ImageController extends Controller | ||
| 372 | //根据项目上传标识区分上传到cos/本地 | 372 | //根据项目上传标识区分上传到cos/本地 |
| 373 | $projectModel = new Project(); | 373 | $projectModel = new Project(); |
| 374 | $project_info = $projectModel->read(['id'=>$this->cache['project_id']],['project_location']); | 374 | $project_info = $projectModel->read(['id'=>$this->cache['project_id']],['project_location']); |
| 375 | - if ($project_info['project_location'] == 0) {//普通项目时 上传到cos | ||
| 376 | - $this->upload_location = 1;//上传到cos | 375 | + if ($project_info['project_location'] != 0) {//危险项目时 上传到本地 |
| 376 | + $this->upload_location = 0;//上传到cos | ||
| 377 | } | 377 | } |
| 378 | } | 378 | } |
| 379 | $this->path = $this->uploads['path_b'].'/'.$this->cache['project_id'].'/'.$this->image_type[$this->param['refer']].'/'.date('Y-m'); | 379 | $this->path = $this->uploads['path_b'].'/'.$this->cache['project_id'].'/'.$this->image_type[$this->param['refer']].'/'.date('Y-m'); |
| @@ -404,11 +404,11 @@ class ImageController extends Controller | @@ -404,11 +404,11 @@ class ImageController extends Controller | ||
| 404 | */ | 404 | */ |
| 405 | public function getDownloadUrl(){ | 405 | public function getDownloadUrl(){ |
| 406 | $imageModel = new ImageModel(); | 406 | $imageModel = new ImageModel(); |
| 407 | - $info = $imageModel->read(['hash' => $this->param['hash']]); | 407 | + $info = $imageModel->read(['path' => $this->param['path']]); |
| 408 | if ($info === false) { | 408 | if ($info === false) { |
| 409 | $this->response('指定文件不存在!', Code::USER_ERROR); | 409 | $this->response('指定文件不存在!', Code::USER_ERROR); |
| 410 | } | 410 | } |
| 411 | - $data = ['image_download'=>url('a/downLoad/images?hash='.$this->param['hash'])]; | 411 | + $data = ['image_download'=>url('a/downLoad/images?path='.$this->param['path'])]; |
| 412 | $this->response('success',Code::SUCCESS,$data); | 412 | $this->response('success',Code::SUCCESS,$data); |
| 413 | } | 413 | } |
| 414 | } | 414 | } |
| @@ -5,6 +5,7 @@ namespace App\Http\Logic\Aside\Domain; | @@ -5,6 +5,7 @@ namespace App\Http\Logic\Aside\Domain; | ||
| 5 | 5 | ||
| 6 | use App\Http\Logic\Aside\BaseLogic; | 6 | use App\Http\Logic\Aside\BaseLogic; |
| 7 | use App\Models\Domain\DomainInfo; | 7 | use App\Models\Domain\DomainInfo; |
| 8 | +use App\Models\Project\DeployOptimize; | ||
| 8 | use App\Models\Project\Project; | 9 | use App\Models\Project\Project; |
| 9 | use GuzzleHttp\Client; | 10 | use GuzzleHttp\Client; |
| 10 | use GuzzleHttp\Exception\GuzzleException; | 11 | use GuzzleHttp\Exception\GuzzleException; |
| @@ -109,7 +110,16 @@ class DomainInfoLogic extends BaseLogic | @@ -109,7 +110,16 @@ class DomainInfoLogic extends BaseLogic | ||
| 109 | * @time :2023/8/1 15:41 | 110 | * @time :2023/8/1 15:41 |
| 110 | */ | 111 | */ |
| 111 | public function delDomain(){ | 112 | public function delDomain(){ |
| 112 | - $this->param['id'] = ['in',$this->param['id']]; | 113 | + $ids = $this->param['id']; |
| 114 | + foreach ($ids as $k => $v){ | ||
| 115 | + $info = $this->model->read(['id'=>$v]); | ||
| 116 | + $deployOptimizeModel = new DeployOptimize(); | ||
| 117 | + $domainInfo = $deployOptimizeModel->read(['domain'=>$info['domain']]); | ||
| 118 | + if($domainInfo !== false){ | ||
| 119 | + $this->fail('当前域名正在使用中'); | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + $this->param['id'] = ['in',$ids]; | ||
| 113 | $rs = $this->model->del($this->param); | 123 | $rs = $this->model->del($this->param); |
| 114 | if($rs === false){ | 124 | if($rs === false){ |
| 115 | $this->fail('error'); | 125 | $this->fail('error'); |
| @@ -48,7 +48,7 @@ class ProjectLogic extends BaseLogic | @@ -48,7 +48,7 @@ class ProjectLogic extends BaseLogic | ||
| 48 | */ | 48 | */ |
| 49 | public function getProjectInfo($id){ | 49 | public function getProjectInfo($id){ |
| 50 | // $info = Common::get_user_cache($this->model->getTable(),$id); | 50 | // $info = Common::get_user_cache($this->model->getTable(),$id); |
| 51 | - if(empty($info)){ | 51 | +// if(empty($info)){ |
| 52 | $info = $this->model->with('payment')->with('deploy_build')->with('deploy_optimize')->with('online_check') | 52 | $info = $this->model->with('payment')->with('deploy_build')->with('deploy_optimize')->with('online_check') |
| 53 | ->with('project_after')->where(['id'=>$id])->first()->toArray(); | 53 | ->with('project_after')->where(['id'=>$id])->first()->toArray(); |
| 54 | if(!empty($info['online_check']['created_manage_id'])){ | 54 | if(!empty($info['online_check']['created_manage_id'])){ |
| @@ -64,7 +64,7 @@ class ProjectLogic extends BaseLogic | @@ -64,7 +64,7 @@ class ProjectLogic extends BaseLogic | ||
| 64 | $info['type'] = $info['extend_type']; | 64 | $info['type'] = $info['extend_type']; |
| 65 | } | 65 | } |
| 66 | // Common::set_user_cache($info,$this->model->getTable(),$id); | 66 | // Common::set_user_cache($info,$this->model->getTable(),$id); |
| 67 | - } | 67 | +// } |
| 68 | return $this->success($info); | 68 | return $this->success($info); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| @@ -117,13 +117,13 @@ class ProjectLogic extends BaseLogic | @@ -117,13 +117,13 @@ class ProjectLogic extends BaseLogic | ||
| 117 | } | 117 | } |
| 118 | if(isset($param['notice_file']) && !empty($param['notice_file'])){ | 118 | if(isset($param['notice_file']) && !empty($param['notice_file'])){ |
| 119 | foreach ($param['notice_file'] as &$v1) { | 119 | foreach ($param['notice_file'] as &$v1) { |
| 120 | - $v1['url'] = basename($v1['url']); | 120 | + $v1['url'] = str_replace_url($v1['url']); |
| 121 | } | 121 | } |
| 122 | $param['notice_file'] = Arr::a2s($param['notice_file']); | 122 | $param['notice_file'] = Arr::a2s($param['notice_file']); |
| 123 | } | 123 | } |
| 124 | if(isset($param['confirm_file']) && !empty($param['confirm_file'])){ | 124 | if(isset($param['confirm_file']) && !empty($param['confirm_file'])){ |
| 125 | foreach ($param['confirm_file'] as &$v2) { | 125 | foreach ($param['confirm_file'] as &$v2) { |
| 126 | - $v2['url'] = basename($v2['url']); | 126 | + $v2['url'] = str_replace_url($v2['url']); |
| 127 | } | 127 | } |
| 128 | $param['confirm_file'] = Arr::a2s($param['confirm_file']); | 128 | $param['confirm_file'] = Arr::a2s($param['confirm_file']); |
| 129 | } | 129 | } |
| @@ -142,7 +142,12 @@ class ProjectLogic extends BaseLogic | @@ -142,7 +142,12 @@ class ProjectLogic extends BaseLogic | ||
| 142 | */ | 142 | */ |
| 143 | protected function saveProjectPayment($payment){ | 143 | protected function saveProjectPayment($payment){ |
| 144 | $paymentModel = new Payment(); | 144 | $paymentModel = new Payment(); |
| 145 | -// $payment['contract'] = Arr::a2s($payment['contract']); | 145 | + if(isset($payment['contract']) && !empty($payment['contract'])){ |
| 146 | + $payment['contract'] = Arr::a2s($payment['contract']); | ||
| 147 | + } | ||
| 148 | + if(isset($payment['bill']) && !empty($payment['bill'])){ | ||
| 149 | + $payment['bill'] = Arr::a2s($payment['bill']); | ||
| 150 | + } | ||
| 146 | if(isset($payment['renewal_record']) && !empty($payment['renewal_record'])){ | 151 | if(isset($payment['renewal_record']) && !empty($payment['renewal_record'])){ |
| 147 | $payment['renewal_record'] = Arr::a2s($payment['renewal_record']); | 152 | $payment['renewal_record'] = Arr::a2s($payment['renewal_record']); |
| 148 | } | 153 | } |
| @@ -29,17 +29,17 @@ class ServiceLogic extends BaseLogic | @@ -29,17 +29,17 @@ class ServiceLogic extends BaseLogic | ||
| 29 | case 'images': | 29 | case 'images': |
| 30 | $arr = explode(',',$v['values']); | 30 | $arr = explode(',',$v['values']); |
| 31 | foreach ($arr as $k1 => $v1){ | 31 | foreach ($arr as $k1 => $v1){ |
| 32 | - $v['images_link'][$k1] = url('a/image/'.$v1); | 32 | + $v['images_link'][$k1] = getImageUrl($v1); |
| 33 | } | 33 | } |
| 34 | break; | 34 | break; |
| 35 | case 'android': | 35 | case 'android': |
| 36 | - $v['android_link'] = url('a/image/'.$v['values']); | 36 | + $v['android_link'] = getImageUrl($v['values']); |
| 37 | break; | 37 | break; |
| 38 | case 'official_account': | 38 | case 'official_account': |
| 39 | - $v['android_link'] = url('a/image/'.$v['values']); | 39 | + $v['android_link'] = getImageUrl($v['values']); |
| 40 | break; | 40 | break; |
| 41 | case 'ios': | 41 | case 'ios': |
| 42 | - $v['ios_link'] = url('a/image/'.$v['values']); | 42 | + $v['ios_link'] = getImageUrl($v['values']); |
| 43 | break; | 43 | break; |
| 44 | } | 44 | } |
| 45 | $lists[$k] = $v; | 45 | $lists[$k] = $v; |
| @@ -107,26 +107,11 @@ class ATemplateModuleLogic extends BaseLogic | @@ -107,26 +107,11 @@ class ATemplateModuleLogic extends BaseLogic | ||
| 107 | */ | 107 | */ |
| 108 | public function aTemplateModuleDel(){ | 108 | public function aTemplateModuleDel(){ |
| 109 | //TODO::查看当前模板是否有模板在使用 | 109 | //TODO::查看当前模板是否有模板在使用 |
| 110 | - $rs = $this->model->edit(['deleted_status'=>1,'deleted_at'=>date('Y-m-d H:i:s')],['id'=>$this->param['id']]); | 110 | + $rs = $this->model->edit(['deleted_status'=>1],['id'=>$this->param['id']]); |
| 111 | if($rs === false){ | 111 | if($rs === false){ |
| 112 | $this->fail('error'); | 112 | $this->fail('error'); |
| 113 | } | 113 | } |
| 114 | return $this->success(); | 114 | return $this->success(); |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | - /** | ||
| 118 | - * @remark :如果是图片名称返回图片hash值 | ||
| 119 | - * @name :imageName | ||
| 120 | - * @author :lyh | ||
| 121 | - * @method :post | ||
| 122 | - * @time :2023/8/31 11:49 | ||
| 123 | - */ | ||
| 124 | - public function imageName($string){ | ||
| 125 | - $imageModel = new Image(); | ||
| 126 | - if (strpos($string, '.') !== false) { | ||
| 127 | - $info = $imageModel->read(['path'=>['like','%'.$string.'%']]); | ||
| 128 | - $string = $info['hash']; | ||
| 129 | - } | ||
| 130 | - return $string; | ||
| 131 | - } | ||
| 132 | } | 117 | } |
| @@ -115,4 +115,19 @@ class ProjectMenuLogic extends BaseLogic | @@ -115,4 +115,19 @@ class ProjectMenuLogic extends BaseLogic | ||
| 115 | $list = $this->model->list(['pid'=>$this->param['id'], 'is_role'=>1]); | 115 | $list = $this->model->list(['pid'=>$this->param['id'], 'is_role'=>1]); |
| 116 | return $this->success($list); | 116 | return $this->success($list); |
| 117 | } | 117 | } |
| 118 | + | ||
| 119 | + /** | ||
| 120 | + * @remark :设置排序 | ||
| 121 | + * @name :setSort | ||
| 122 | + * @author :lyh | ||
| 123 | + * @method :post | ||
| 124 | + * @time :2023/8/10 16:42 | ||
| 125 | + */ | ||
| 126 | + public function setParamStatus(){ | ||
| 127 | + $rs = $this->model->edit(['sort'=>$this->param['sort']],['id'=>$this->param['id']]); | ||
| 128 | + if($rs === false){ | ||
| 129 | + $this->fail('修改失败'); | ||
| 130 | + } | ||
| 131 | + return $this->success(); | ||
| 132 | + } | ||
| 118 | } | 133 | } |
| @@ -159,4 +159,19 @@ class UserLogic extends BaseLogic | @@ -159,4 +159,19 @@ class UserLogic extends BaseLogic | ||
| 159 | Common::del_user_cache($this->model, $ids, 'A'); | 159 | Common::del_user_cache($this->model, $ids, 'A'); |
| 160 | return $this->success(); | 160 | return $this->success(); |
| 161 | } | 161 | } |
| 162 | + | ||
| 163 | + /** | ||
| 164 | + * @remark :设置排序 | ||
| 165 | + * @name :setSort | ||
| 166 | + * @author :lyh | ||
| 167 | + * @method :post | ||
| 168 | + * @time :2023/8/10 16:42 | ||
| 169 | + */ | ||
| 170 | + public function setParamStatus(){ | ||
| 171 | + $rs = $this->model->edit(['sort'=>$this->param['sort']],['id'=>$this->param['id']]); | ||
| 172 | + if($rs === false){ | ||
| 173 | + $this->fail('修改失败'); | ||
| 174 | + } | ||
| 175 | + return $this->success(); | ||
| 176 | + } | ||
| 162 | } | 177 | } |
| @@ -174,8 +174,8 @@ class BTemplateLogic extends BaseLogic | @@ -174,8 +174,8 @@ class BTemplateLogic extends BaseLogic | ||
| 174 | */ | 174 | */ |
| 175 | public function templateSave(){ | 175 | public function templateSave(){ |
| 176 | //查询当前模版是否已保存 | 176 | //查询当前模版是否已保存 |
| 177 | -// DB::beginTransaction(); | ||
| 178 | -// try { | 177 | + DB::beginTransaction(); |
| 178 | + try { | ||
| 179 | $info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']); | 179 | $info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']); |
| 180 | //字符串截取 | 180 | //字符串截取 |
| 181 | $this->param = $this->stringProcessing($this->param); | 181 | $this->param = $this->stringProcessing($this->param); |
| @@ -186,11 +186,13 @@ class BTemplateLogic extends BaseLogic | @@ -186,11 +186,13 @@ class BTemplateLogic extends BaseLogic | ||
| 186 | $this->model->edit($this->param,['id'=>$info['id']]); | 186 | $this->model->edit($this->param,['id'=>$info['id']]); |
| 187 | } | 187 | } |
| 188 | $this->setTemplateLog($this->param); | 188 | $this->setTemplateLog($this->param); |
| 189 | -// DB::commit(); | ||
| 190 | -// }catch (\Exception $e){ | ||
| 191 | -// DB::rollBack(); | ||
| 192 | -// $this->fail('error'); | ||
| 193 | -// } | 189 | + //路由映射 |
| 190 | + RouteMap::setRoute('index', RouteMap::SOURCE_PAGE, 0, $this->user['project_id']); | ||
| 191 | + DB::commit(); | ||
| 192 | + }catch (\Exception $e){ | ||
| 193 | + DB::rollBack(); | ||
| 194 | + $this->fail('error'); | ||
| 195 | + } | ||
| 194 | //通知更新 | 196 | //通知更新 |
| 195 | $this->homeOrProduct($this->param['source'],$this->param['source_id']); | 197 | $this->homeOrProduct($this->param['source'],$this->param['source_id']); |
| 196 | return $this->success(); | 198 | return $this->success(); |
| @@ -182,17 +182,17 @@ class CountLogic extends BaseLogic | @@ -182,17 +182,17 @@ class CountLogic extends BaseLogic | ||
| 182 | case 'images': | 182 | case 'images': |
| 183 | $arr = explode(',',$v['values']); | 183 | $arr = explode(',',$v['values']); |
| 184 | foreach ($arr as $k1 => $v1){ | 184 | foreach ($arr as $k1 => $v1){ |
| 185 | - $v['images_link'][$k1] = url('a/image/'.$v1); | 185 | + $v['images_link'][$k1] = getImageUrl($v1); |
| 186 | } | 186 | } |
| 187 | break; | 187 | break; |
| 188 | case 'android': | 188 | case 'android': |
| 189 | - $v['android_link'] = url('a/image/'.$v['values']); | 189 | + $v['android_link'] = getImageUrl($v['values']); |
| 190 | break; | 190 | break; |
| 191 | case 'official_account': | 191 | case 'official_account': |
| 192 | - $v['official_account_link'] = url('a/image/'.$v['values']); | 192 | + $v['official_account_link'] = getImageUrl($v['values']); |
| 193 | break; | 193 | break; |
| 194 | case 'ios': | 194 | case 'ios': |
| 195 | - $v['ios_link'] = url('a/image/'.$v['values']); | 195 | + $v['ios_link'] = getImageUrl($v['values']); |
| 196 | break; | 196 | break; |
| 197 | } | 197 | } |
| 198 | $lists[$k] = $v; | 198 | $lists[$k] = $v; |
| @@ -26,12 +26,10 @@ class MonthCountLogic extends BaseLogic | @@ -26,12 +26,10 @@ class MonthCountLogic extends BaseLogic | ||
| 26 | * @method :post | 26 | * @method :post |
| 27 | * @time :2023/7/3 9:39 | 27 | * @time :2023/7/3 9:39 |
| 28 | */ | 28 | */ |
| 29 | - public function getCountLists($map,$page,$row = 10,$order = 'created_at',$filed = ['*']){ | 29 | + public function getCountLists($map,$order = 'created_at',$filed = ['*']){ |
| 30 | $map['project_id'] = $this->user['project_id']; | 30 | $map['project_id'] = $this->user['project_id']; |
| 31 | - $lists = $this->model->lists($map,$page,$row,$order,$filed); | ||
| 32 | - if(!empty($lists)){ | ||
| 33 | - $lists['list']['new'] = $this->currentMonthCount(); | ||
| 34 | - } | 31 | + $lists = $this->model->list($map,$order,$filed); |
| 32 | + $lists['new'] = $this->currentMonthCount(); | ||
| 35 | return $this->success($lists); | 33 | return $this->success($lists); |
| 36 | } | 34 | } |
| 37 | 35 | ||
| @@ -99,7 +97,7 @@ class MonthCountLogic extends BaseLogic | @@ -99,7 +97,7 @@ class MonthCountLogic extends BaseLogic | ||
| 99 | public function flowCount(&$arr,&$startTime,&$endTime,$project_id){ | 97 | public function flowCount(&$arr,&$startTime,&$endTime,$project_id){ |
| 100 | $pv_ip = DB::table('gl_count') | 98 | $pv_ip = DB::table('gl_count') |
| 101 | ->where(['project_id'=>$project_id]) | 99 | ->where(['project_id'=>$project_id]) |
| 102 | - ->whereBetween('date', [$startTime.' 00:00:00',$endTime.' 23:59:59']) | 100 | + ->whereBetween('date', [$startTime,$endTime]) |
| 103 | ->select(DB::raw('SUM(pv_num) as pv_num'), DB::raw('SUM(ip_num) as ip_num')) | 101 | ->select(DB::raw('SUM(pv_num) as pv_num'), DB::raw('SUM(ip_num) as ip_num')) |
| 104 | ->first(); | 102 | ->first(); |
| 105 | $arr['pv'] = $pv_ip->pv_num; | 103 | $arr['pv'] = $pv_ip->pv_num; |
| @@ -170,6 +168,9 @@ class MonthCountLogic extends BaseLogic | @@ -170,6 +168,9 @@ class MonthCountLogic extends BaseLogic | ||
| 170 | if(!isset($groupedData[$month])){ | 168 | if(!isset($groupedData[$month])){ |
| 171 | $groupedData[$month] = []; | 169 | $groupedData[$month] = []; |
| 172 | } | 170 | } |
| 171 | + if(empty($v['country'])){ | ||
| 172 | + $v['country'] = ['中国'=>0]; | ||
| 173 | + } | ||
| 173 | $groupedData[$month][] = $v; | 174 | $groupedData[$month][] = $v; |
| 174 | } | 175 | } |
| 175 | return $this->success($groupedData); | 176 | return $this->success($groupedData); |
| @@ -8,6 +8,7 @@ use App\Helper\QuanqiusouApi; | @@ -8,6 +8,7 @@ use App\Helper\QuanqiusouApi; | ||
| 8 | use App\Helper\Translate; | 8 | use App\Helper\Translate; |
| 9 | use App\Http\Logic\Aside\Project\DomainInfoLogic; | 9 | use App\Http\Logic\Aside\Project\DomainInfoLogic; |
| 10 | use App\Http\Logic\Aside\Project\ProjectLogic; | 10 | use App\Http\Logic\Aside\Project\ProjectLogic; |
| 11 | +use App\Models\Project\Project; | ||
| 11 | use App\Models\RankData\ExternalLinks; | 12 | use App\Models\RankData\ExternalLinks; |
| 12 | use App\Models\RankData\IndexedPages; | 13 | use App\Models\RankData\IndexedPages; |
| 13 | use App\Models\RankData\RankData; | 14 | use App\Models\RankData\RankData; |
| @@ -58,7 +59,7 @@ class RankDataLogic extends BaseLogic | @@ -58,7 +59,7 @@ class RankDataLogic extends BaseLogic | ||
| 58 | 'domain' => $project['deploy_optimize']['domain'] ?? '', | 59 | 'domain' => $project['deploy_optimize']['domain'] ?? '', |
| 59 | 'domain_info' => ($domain_info['domain_info']['creation_date'] ?? '') . ' - ' . ($domain_info['domain_info']['expiration_date'] ?? ''), | 60 | 'domain_info' => ($domain_info['domain_info']['creation_date'] ?? '') . ' - ' . ($domain_info['domain_info']['expiration_date'] ?? ''), |
| 60 | 'cert_info' => ($domain_info['ssl']['start_time'] ?? '') . ' - ' . ($domain_info['ssl']['end_time'] ?? ''), | 61 | 'cert_info' => ($domain_info['ssl']['start_time'] ?? '') . ' - ' . ($domain_info['ssl']['end_time'] ?? ''), |
| 61 | - 'plan' => str_replace('营销大师-', '全球搜-', $project['deploy_build']['plan'][0] ?? ''), | 62 | + 'plan' => Project::planMap()[$project['deploy_build']['plan']], |
| 62 | 'keyword_num' => $project['deploy_build']['keyword_num'], | 63 | 'keyword_num' => $project['deploy_build']['keyword_num'], |
| 63 | 'compliance_day' => $rank['compliance_day'] ?? 0, | 64 | 'compliance_day' => $rank['compliance_day'] ?? 0, |
| 64 | 'remain_day' => $project['deploy_build']['service_duration'] - ($rank['compliance_day'] ?? 0), | 65 | 'remain_day' => $project['deploy_build']['service_duration'] - ($rank['compliance_day'] ?? 0), |
| @@ -78,7 +78,7 @@ class WebSettingLogic extends BaseLogic | @@ -78,7 +78,7 @@ class WebSettingLogic extends BaseLogic | ||
| 78 | ]; | 78 | ]; |
| 79 | $string = http_build_query($param); | 79 | $string = http_build_query($param); |
| 80 | $urlStr = $this->user['domain'].'api/updateHtmlNotify/?' . $string; | 80 | $urlStr = $this->user['domain'].'api/updateHtmlNotify/?' . $string; |
| 81 | - http_get($urlStr); | 81 | + http_get($urlStr,["charset = UTF-8"]); |
| 82 | return $this->success(); | 82 | return $this->success(); |
| 83 | } | 83 | } |
| 84 | 84 |
| @@ -74,7 +74,7 @@ class UserLogic extends BaseLogic | @@ -74,7 +74,7 @@ class UserLogic extends BaseLogic | ||
| 74 | } | 74 | } |
| 75 | $this->param['type'] = 1; | 75 | $this->param['type'] = 1; |
| 76 | $this->param['operator_id'] = $this->user['id']; | 76 | $this->param['operator_id'] = $this->user['id']; |
| 77 | - $this->edits($this->param); | 77 | + $this->edits(); |
| 78 | return $this->success(); | 78 | return $this->success(); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| @@ -116,20 +116,24 @@ class UserLogic extends BaseLogic | @@ -116,20 +116,24 @@ class UserLogic extends BaseLogic | ||
| 116 | * @method :post | 116 | * @method :post |
| 117 | * @time :2023/6/17 16:41 | 117 | * @time :2023/6/17 16:41 |
| 118 | */ | 118 | */ |
| 119 | - public function edits($param){ | ||
| 120 | - //查看密码是否修改 | ||
| 121 | - $info = $this->model->read(['id'=>$param['id']]); | ||
| 122 | - $param['password'] = base64_encode(md5($param['password'])); | ||
| 123 | - if($param['password'] == $info['password']){ | ||
| 124 | - unset($param['password']); | 119 | + public function edits(){ |
| 120 | + if(!isset($this->param['password']) || empty($this->param['password'])){ | ||
| 121 | + unset($this->param['password']); | ||
| 122 | + }else{ | ||
| 123 | + $this->param['password'] = base64_encode(md5($this->param['password'])); | ||
| 124 | + } | ||
| 125 | + $info = $this->model->read(['mobile'=>$this->param['mobile'], | ||
| 126 | + 'project_id'=>$this->user['project_id'],'id'=>['!=',$this->param['id']]]); | ||
| 127 | + if($info !== false){ | ||
| 128 | + $this->fail('当前手机号码已注册'); | ||
| 125 | } | 129 | } |
| 126 | //密码加密 | 130 | //密码加密 |
| 127 | - $rs = $this->model->edit($param,['id'=>$param['id']]); | 131 | + $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); |
| 128 | if($rs === false){ | 132 | if($rs === false){ |
| 129 | $this->fail('系统错误,请联系管理员'); | 133 | $this->fail('系统错误,请联系管理员'); |
| 130 | } | 134 | } |
| 131 | //清空当前用户登录缓存 | 135 | //清空当前用户登录缓存 |
| 132 | - Cache::pull($info['token']); | 136 | + Cache::pull($this->user['token']); |
| 133 | return $this->success(); | 137 | return $this->success(); |
| 134 | } | 138 | } |
| 135 | } | 139 | } |
| @@ -10,6 +10,7 @@ use App\Models\Project\Project; | @@ -10,6 +10,7 @@ use App\Models\Project\Project; | ||
| 10 | use App\Models\Sms\SmsLog; | 10 | use App\Models\Sms\SmsLog; |
| 11 | use App\Models\User\ProjectRole as ProjectRoleModel; | 11 | use App\Models\User\ProjectRole as ProjectRoleModel; |
| 12 | use App\Models\User\User; | 12 | use App\Models\User\User; |
| 13 | +use App\Models\User\User as UserModel; | ||
| 13 | use Illuminate\Support\Facades\Cache; | 14 | use Illuminate\Support\Facades\Cache; |
| 14 | 15 | ||
| 15 | class UserLoginLogic | 16 | class UserLoginLogic |
| @@ -96,7 +97,7 @@ class UserLoginLogic | @@ -96,7 +97,7 @@ class UserLoginLogic | ||
| 96 | { | 97 | { |
| 97 | //项目自动登录 | 98 | //项目自动登录 |
| 98 | if(isset($data['project_id']) && !empty($data['project_id'])){ | 99 | if(isset($data['project_id']) && !empty($data['project_id'])){ |
| 99 | - $has_user = $this->model->read(['project_id'=>$data['project_id'],'role_id'=>0]); | 100 | + $has_user = $this->model->read(['project_id'=>$data['project_id'],'role_id'=>$this->model::ROLE_MANAGER]); |
| 100 | } | 101 | } |
| 101 | //根据特定用户自动登录 | 102 | //根据特定用户自动登录 |
| 102 | if(isset($data['user_id']) && !empty($data['user_id'])){ | 103 | if(isset($data['user_id']) && !empty($data['user_id'])){ |
| @@ -151,6 +152,9 @@ class UserLoginLogic | @@ -151,6 +152,9 @@ class UserLoginLogic | ||
| 151 | $project = $this->getProjectInfo($info['project_id']); | 152 | $project = $this->getProjectInfo($info['project_id']); |
| 152 | $info['title'] = $project['title'] ?? ''; | 153 | $info['title'] = $project['title'] ?? ''; |
| 153 | $info['company'] = $project['company'] ?? ''; | 154 | $info['company'] = $project['company'] ?? ''; |
| 155 | + $info['from_order_id'] = $project['from_order_id'] ?? ''; | ||
| 156 | + $info['aicc'] = $project['aicc'] ?? ''; | ||
| 157 | + $info['hagro'] = $project['hagro'] ?? ''; | ||
| 154 | $info['plan'] = Project::planMap()[$project['deploy_build']['plan']]; | 158 | $info['plan'] = Project::planMap()[$project['deploy_build']['plan']]; |
| 155 | $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? | 159 | $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? |
| 156 | $project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? '')); | 160 | $project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? '')); |
| @@ -172,6 +176,9 @@ class UserLoginLogic | @@ -172,6 +176,9 @@ class UserLoginLogic | ||
| 172 | $project = $this->getProjectInfo($project_id); | 176 | $project = $this->getProjectInfo($project_id); |
| 173 | $info['title'] = $project['title'] ?? ''; | 177 | $info['title'] = $project['title'] ?? ''; |
| 174 | $info['company'] = $project['company'] ?? ''; | 178 | $info['company'] = $project['company'] ?? ''; |
| 179 | + $info['from_order_id'] = $project['from_order_id'] ?? ''; | ||
| 180 | + $info['aicc'] = $project['aicc'] ?? ''; | ||
| 181 | + $info['hagro'] = $project['hagro'] ?? ''; | ||
| 175 | $info['plan'] = Project::planMap()[$project['deploy_build']['plan']]; | 182 | $info['plan'] = Project::planMap()[$project['deploy_build']['plan']]; |
| 176 | $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? | 183 | $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? |
| 177 | $project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? '')); | 184 | $project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? '')); |
| @@ -197,6 +204,68 @@ class UserLoginLogic | @@ -197,6 +204,68 @@ class UserLoginLogic | ||
| 197 | } | 204 | } |
| 198 | return $this->success($info); | 205 | return $this->success($info); |
| 199 | } | 206 | } |
| 207 | + | ||
| 208 | + /** | ||
| 209 | + * @remark :扫码登录 | ||
| 210 | + * @name :wechatLogin | ||
| 211 | + * @author :lyh | ||
| 212 | + * @method :post | ||
| 213 | + * @time :2023/9/1 11:29 | ||
| 214 | + */ | ||
| 215 | + public function wechatLogin($wechat){ | ||
| 216 | + $info = $this->model->read(['wechat'=>$wechat]); | ||
| 217 | + if($info === false){ | ||
| 218 | + $data = [ | ||
| 219 | + 'code'=>0, | ||
| 220 | + 'message'=>'当前用户未绑定账户,请绑定后登录', | ||
| 221 | + ]; | ||
| 222 | + }else { | ||
| 223 | + //获取项目详情 | ||
| 224 | + $info = $this->autoAssembleParam($info); | ||
| 225 | + if(isset($info['token']) && !empty($info['token'])){ | ||
| 226 | + //清除上一次用户缓存 | ||
| 227 | + Cache::pull($info['token']); | ||
| 228 | + } | ||
| 229 | + //生成新token | ||
| 230 | + $token = md5(uniqid().$info['id']); | ||
| 231 | + //存储缓存 | ||
| 232 | + $info['token'] = $token; | ||
| 233 | + Cache::add($token,$info,3600); | ||
| 234 | + //更新用户信息 | ||
| 235 | + $this->model->edit(['token'=>$token],['id'=>$info['id']]); | ||
| 236 | + $data = [ | ||
| 237 | + 'code'=>1, | ||
| 238 | + 'message'=>'登陆成功', | ||
| 239 | + 'data'=>$info | ||
| 240 | + ]; | ||
| 241 | + } | ||
| 242 | + return $this->success($data); | ||
| 243 | + } | ||
| 244 | + | ||
| 245 | + /** | ||
| 246 | + * @remark :微信绑定 | ||
| 247 | + * @name :wechatBind | ||
| 248 | + * @author :lyh | ||
| 249 | + * @method :post | ||
| 250 | + * @time :2023/9/1 11:43 | ||
| 251 | + */ | ||
| 252 | + public function wechatBind($wechat,$id){ | ||
| 253 | + $info = $this->model->read(['wechat'=>$wechat]); | ||
| 254 | + if($info !== false){ | ||
| 255 | + $data = [ | ||
| 256 | + 'code'=>0, | ||
| 257 | + 'message'=>'当前微信已绑定其他微信,请解绑后再操作', | ||
| 258 | + ]; | ||
| 259 | + }else{ | ||
| 260 | + $this->model->edit(['wechat'=>$wechat],['id'=>(int)$id]); | ||
| 261 | + $data = [ | ||
| 262 | + 'code'=>2, | ||
| 263 | + 'message'=>'绑定成功', | ||
| 264 | + ]; | ||
| 265 | + } | ||
| 266 | + return $this->success($data); | ||
| 267 | + } | ||
| 268 | + | ||
| 200 | /** | 269 | /** |
| 201 | * @notes: 请简要描述方法功能 | 270 | * @notes: 请简要描述方法功能 |
| 202 | * @param array $data | 271 | * @param array $data |
| @@ -16,6 +16,8 @@ class Project extends Base | @@ -16,6 +16,8 @@ class Project extends Base | ||
| 16 | 16 | ||
| 17 | const DATABASE_NAME_FIX = 'gl_data_'; | 17 | const DATABASE_NAME_FIX = 'gl_data_'; |
| 18 | 18 | ||
| 19 | + const DEMO_PROJECT_ID = 1; | ||
| 20 | + | ||
| 19 | const STATUS_ONE = 1;//审核通过 | 21 | const STATUS_ONE = 1;//审核通过 |
| 20 | const TYPE_ZERO = 0;//初始导入项目 | 22 | const TYPE_ZERO = 0;//初始导入项目 |
| 21 | const TYPE_ONE = 1;//建站中 | 23 | const TYPE_ONE = 1;//建站中 |
| @@ -224,7 +226,7 @@ class Project extends Base | @@ -224,7 +226,7 @@ class Project extends Base | ||
| 224 | $value = Arr::s2a($value); | 226 | $value = Arr::s2a($value); |
| 225 | if(!empty($value)) { | 227 | if(!empty($value)) { |
| 226 | foreach ($value as &$v) { | 228 | foreach ($value as &$v) { |
| 227 | - $v['url'] = getImageUrl($v['url']); | 229 | + $v['url'] = getFileUrl($v['url']); |
| 228 | } | 230 | } |
| 229 | } | 231 | } |
| 230 | return $value; | 232 | return $value; |
| @@ -243,7 +245,7 @@ class Project extends Base | @@ -243,7 +245,7 @@ class Project extends Base | ||
| 243 | $value = Arr::s2a($value); | 245 | $value = Arr::s2a($value); |
| 244 | if(!empty($value)) { | 246 | if(!empty($value)) { |
| 245 | foreach ($value as &$v) { | 247 | foreach ($value as &$v) { |
| 246 | - $v['url'] = getImageUrl($v['url']); | 248 | + $v['url'] = getFileUrl($v['url']); |
| 247 | } | 249 | } |
| 248 | } | 250 | } |
| 249 | return $value; | 251 | return $value; |
| @@ -18,26 +18,6 @@ class User extends Base | @@ -18,26 +18,6 @@ class User extends Base | ||
| 18 | protected $table = 'gl_project_user'; | 18 | protected $table = 'gl_project_user'; |
| 19 | //自动维护create_at创建时间 updated_at修改时间 | 19 | //自动维护create_at创建时间 updated_at修改时间 |
| 20 | public $timestamps = true; | 20 | public $timestamps = true; |
| 21 | - /** | ||
| 22 | - * The attributes that are mass assignable. | ||
| 23 | - * | ||
| 24 | - * @var array<int, string> | ||
| 25 | - */ | ||
| 26 | - protected $fillable = [ | ||
| 27 | -// 'name', | ||
| 28 | - 'email', | ||
| 29 | - 'password', | ||
| 30 | - ]; | ||
| 31 | - | ||
| 32 | - /** | ||
| 33 | - * The attributes that should be hidden for serialization. | ||
| 34 | - * | ||
| 35 | - * @var array<int, string> | ||
| 36 | - */ | ||
| 37 | - protected $hidden = [ | ||
| 38 | -// 'password', | ||
| 39 | - 'remember_token', | ||
| 40 | - ]; | ||
| 41 | 21 | ||
| 42 | /** | 22 | /** |
| 43 | * The attributes that should be cast. | 23 | * The attributes that should be cast. |
| @@ -19,15 +19,15 @@ return [ | @@ -19,15 +19,15 @@ return [ | ||
| 19 | 'size' => [ | 19 | 'size' => [ |
| 20 | 'max' => 1024*1024*2, // 2M | 20 | 'max' => 1024*1024*2, // 2M |
| 21 | ], | 21 | ], |
| 22 | - 'path_b' => '/p', | ||
| 23 | - 'path_a' => '/m', | 22 | + 'path_b' => '/upload/p', |
| 23 | + 'path_a' => '/upload/m', | ||
| 24 | ], | 24 | ], |
| 25 | //默认视频 | 25 | //默认视频 |
| 26 | 'default_file' =>[ | 26 | 'default_file' =>[ |
| 27 | 'size' => [ | 27 | 'size' => [ |
| 28 | 'max' => 1024*1024*20, // 2M | 28 | 'max' => 1024*1024*20, // 2M |
| 29 | ], | 29 | ], |
| 30 | - 'path_b' => '/p', | ||
| 31 | - 'path_a' => '/m', | 30 | + 'path_b' => '/upload/p', |
| 31 | + 'path_a' => '/upload/m', | ||
| 32 | ], | 32 | ], |
| 33 | ]; | 33 | ]; |
| @@ -20,6 +20,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -20,6 +20,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 20 | Route::any('/save', [Aside\User\ProjectUserController::class, 'save'])->name('admin.user_save'); | 20 | Route::any('/save', [Aside\User\ProjectUserController::class, 'save'])->name('admin.user_save'); |
| 21 | Route::any('/del', [Aside\User\ProjectUserController::class, 'del'])->name('admin.user_del'); | 21 | Route::any('/del', [Aside\User\ProjectUserController::class, 'del'])->name('admin.user_del'); |
| 22 | Route::any('/getRole', [Aside\User\ProjectUserController::class, 'getRole'])->name('admin.user_getRole'); | 22 | Route::any('/getRole', [Aside\User\ProjectUserController::class, 'getRole'])->name('admin.user_getRole'); |
| 23 | + Route::any('/sort', [Aside\User\ProjectUserController::class, 'sort'])->name('admin.user_sort'); | ||
| 23 | 24 | ||
| 24 | //角色管理 | 25 | //角色管理 |
| 25 | Route::prefix('role')->group(function () { | 26 | Route::prefix('role')->group(function () { |
| @@ -41,6 +42,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -41,6 +42,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 41 | Route::any('/del', [Aside\User\ProjectMenuController::class, 'del'])->name('admin.user_menu_del'); | 42 | Route::any('/del', [Aside\User\ProjectMenuController::class, 'del'])->name('admin.user_menu_del'); |
| 42 | Route::any('/getSonMenu', [Aside\User\ProjectMenuController::class, 'getSonMenu'])->name('admin.user_menu_getSonMenu'); | 43 | Route::any('/getSonMenu', [Aside\User\ProjectMenuController::class, 'getSonMenu'])->name('admin.user_menu_getSonMenu'); |
| 43 | Route::any('/routes', [Aside\User\ProjectMenuController::class, 'routes'])->name('admin.user_menu_routes'); | 44 | Route::any('/routes', [Aside\User\ProjectMenuController::class, 'routes'])->name('admin.user_menu_routes'); |
| 45 | + Route::any('/sort', [Aside\User\ProjectMenuController::class, 'sort'])->name('admin.user_menu_sort'); | ||
| 44 | }); | 46 | }); |
| 45 | 47 | ||
| 46 | //用户组 | 48 | //用户组 |
| @@ -156,6 +158,8 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -156,6 +158,8 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 156 | Route::prefix('keyword')->group(function () { | 158 | Route::prefix('keyword')->group(function () { |
| 157 | Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix'); | 159 | Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix'); |
| 158 | }); | 160 | }); |
| 161 | + //更新项目tdk | ||
| 162 | + Route::any('/updateSeoTdk', [Aside\Com\UpdateController::class, 'updateSeoTdk'])->name('admin.project_updateSeoTdk'); | ||
| 159 | }); | 163 | }); |
| 160 | 164 | ||
| 161 | //续费 | 165 | //续费 |
| @@ -173,6 +177,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -173,6 +177,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 173 | Route::post('/save', [Aside\Task\TaskController::class, 'save'])->name('admin.task_save'); | 177 | Route::post('/save', [Aside\Task\TaskController::class, 'save'])->name('admin.task_save'); |
| 174 | Route::post('/status', [Aside\Task\TaskController::class, 'status'])->name('admin.task_status'); | 178 | Route::post('/status', [Aside\Task\TaskController::class, 'status'])->name('admin.task_status'); |
| 175 | Route::post('/save_follow', [Aside\Task\TaskController::class, 'save_follow'])->name('admin.task_save_follow'); | 179 | Route::post('/save_follow', [Aside\Task\TaskController::class, 'save_follow'])->name('admin.task_save_follow'); |
| 180 | + Route::any('/getUserTaskList', [Aside\Task\TaskController::class, 'getUserTaskList'])->name('admin.task_getUserTaskList'); | ||
| 176 | }); | 181 | }); |
| 177 | //服务器配置 | 182 | //服务器配置 |
| 178 | Route::prefix('devops')->group(function () { | 183 | Route::prefix('devops')->group(function () { |
| @@ -222,6 +227,11 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -222,6 +227,11 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 222 | Route::any('/', [Aside\Optimize\OptimizeController::class, 'lists'])->name('admin.optimize_lists');//优化中台 | 227 | Route::any('/', [Aside\Optimize\OptimizeController::class, 'lists'])->name('admin.optimize_lists');//优化中台 |
| 223 | }); | 228 | }); |
| 224 | 229 | ||
| 230 | + //优化中台 | ||
| 231 | + Route::prefix('keyword')->group(function () { | ||
| 232 | + Route::any('/', [Aside\Optimize\KeywordsController::class, 'lists'])->name('admin.optimize_keywords_lists');//优化中台 | ||
| 233 | + }); | ||
| 234 | + | ||
| 225 | //上线审核列表 | 235 | //上线审核列表 |
| 226 | Route::prefix('online')->group(function () { | 236 | Route::prefix('online')->group(function () { |
| 227 | Route::any('/', [Aside\Optimize\OnlineController::class, 'lists'])->name('admin.online_lists');//上线审核列表 | 237 | Route::any('/', [Aside\Optimize\OnlineController::class, 'lists'])->name('admin.online_lists');//上线审核列表 |
| @@ -10,6 +10,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -10,6 +10,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 10 | //登录用户编辑个人资料 | 10 | //登录用户编辑个人资料 |
| 11 | Route::any('/edit_info', [\App\Http\Controllers\Bside\BCom\ComController::class, 'edit_info'])->name('edit_info'); | 11 | Route::any('/edit_info', [\App\Http\Controllers\Bside\BCom\ComController::class, 'edit_info'])->name('edit_info'); |
| 12 | Route::any('/logout', [\App\Http\Controllers\Bside\BCom\ComController::class, 'logout'])->name('logout'); | 12 | Route::any('/logout', [\App\Http\Controllers\Bside\BCom\ComController::class, 'logout'])->name('logout'); |
| 13 | + Route::any('/unbindWechat', [\App\Http\Controllers\Bside\BCom\ComController::class, 'unbindWechat'])->name('unbindWechat'); | ||
| 13 | //获取当前登录用户菜单 | 14 | //获取当前登录用户菜单 |
| 14 | Route::any('/get_menu', [\App\Http\Controllers\Bside\BCom\ComController::class, 'get_menu'])->name('get_menu'); | 15 | Route::any('/get_menu', [\App\Http\Controllers\Bside\BCom\ComController::class, 'get_menu'])->name('get_menu'); |
| 15 | //获取当前登录用户项目详情 | 16 | //获取当前登录用户项目详情 |
| @@ -344,4 +345,5 @@ Route::group([], function () { | @@ -344,4 +345,5 @@ Route::group([], function () { | ||
| 344 | Route::any('/autologin', [\App\Http\Controllers\Bside\LoginController::class, 'autologin'])->name('autologin'); | 345 | Route::any('/autologin', [\App\Http\Controllers\Bside\LoginController::class, 'autologin'])->name('autologin'); |
| 345 | Route::any('/qrcode', [\App\Http\Controllers\Bside\LoginController::class, 'qrcode'])->name('qrcode'); | 346 | Route::any('/qrcode', [\App\Http\Controllers\Bside\LoginController::class, 'qrcode'])->name('qrcode'); |
| 346 | Route::any('/globalSo_v6_login', [\App\Http\Controllers\Bside\LoginController::class, 'globalSo_v6_login'])->name('globalSo_v6_login'); | 347 | Route::any('/globalSo_v6_login', [\App\Http\Controllers\Bside\LoginController::class, 'globalSo_v6_login'])->name('globalSo_v6_login'); |
| 348 | + Route::any('/getWechatLoginInfo', [\App\Http\Controllers\Bside\LoginController::class, 'getWechatLoginInfo'])->name('getWechatLoginInfo'); | ||
| 347 | }); | 349 | }); |
-
请 注册 或 登录 后发表评论