Merge remote-tracking branch 'origin/master' into akun
正在显示
25 个修改的文件
包含
206 行增加
和
79 行删除
| @@ -197,7 +197,10 @@ class RelayInquiry extends Command | @@ -197,7 +197,10 @@ class RelayInquiry extends Command | ||
| 197 | continue; | 197 | continue; |
| 198 | } | 198 | } |
| 199 | // 未设置对法对象 | 199 | // 未设置对法对象 |
| 200 | - if (empty($ad_task['target'])) { | 200 | + $target_num_arr = array_map(function ($item) { |
| 201 | + return count($item['target']); | ||
| 202 | + }, $ad_task); | ||
| 203 | + if (!array_sum($target_num_arr)) { | ||
| 201 | $val->status = ReInquiryForm::STATUS_FORGO; | 204 | $val->status = ReInquiryForm::STATUS_FORGO; |
| 202 | $val->remark = '广告任务转发对象为空!'; | 205 | $val->remark = '广告任务转发对象为空!'; |
| 203 | $val->save(); | 206 | $val->save(); |
| @@ -213,9 +216,14 @@ class RelayInquiry extends Command | @@ -213,9 +216,14 @@ class RelayInquiry extends Command | ||
| 213 | } | 216 | } |
| 214 | 217 | ||
| 215 | try { | 218 | try { |
| 216 | - $this->relayDetail($ad_task, $val); | 219 | + $res = false; |
| 220 | + foreach ($ad_task as $task){ | ||
| 221 | + $res += $this->relayDetail($task, $val); | ||
| 222 | + } | ||
| 223 | + $val->status = $res ? ReInquiryForm::STATUS_SUCCESS : ReInquiryForm::STATUS_FORGO; | ||
| 224 | + $val->save(); | ||
| 217 | } catch (\Exception $e) { | 225 | } catch (\Exception $e) { |
| 218 | - $this->logChannel()->info('执行询盘错误:' . $e->getMessage()); | 226 | + $this->logChannel()->info('执行询盘错误:',[$e->getMessage(), $e->getFile(), $e->getLine()]); |
| 219 | $this->output('执行询盘错误:' . $e->getMessage()); | 227 | $this->output('执行询盘错误:' . $e->getMessage()); |
| 220 | } | 228 | } |
| 221 | } | 229 | } |
| @@ -294,9 +302,7 @@ class RelayInquiry extends Command | @@ -294,9 +302,7 @@ class RelayInquiry extends Command | ||
| 294 | 302 | ||
| 295 | if (empty($random_data)) { | 303 | if (empty($random_data)) { |
| 296 | $this->logChannel()->info('当前任务未发现转发对象!', ['广告任务ID:' . $task['id'], '询盘ID:' . $form->id]); | 304 | $this->logChannel()->info('当前任务未发现转发对象!', ['广告任务ID:' . $task['id'], '询盘ID:' . $form->id]); |
| 297 | - $form->status = ReInquiryForm::STATUS_FORGO; | ||
| 298 | - $form->remark = '当前任务未发现转发对象,广告ID: ' . $form->ad_id . '!'; | ||
| 299 | - $form->save(); | 305 | + $form->remark = $form->remark . '当前任务未发现转发对象,广告ID: ' . $form->ad_id . '!'; |
| 300 | return false; | 306 | return false; |
| 301 | } | 307 | } |
| 302 | 308 | ||
| @@ -385,12 +391,22 @@ class RelayInquiry extends Command | @@ -385,12 +391,22 @@ class RelayInquiry extends Command | ||
| 385 | //开启文案替换 | 391 | //开启文案替换 |
| 386 | if ($task['is_replace_text'] == 2) { | 392 | if ($task['is_replace_text'] == 2) { |
| 387 | //AI生成 | 393 | //AI生成 |
| 388 | - $message = $this->ai_send($task['ai_param'], $message); | ||
| 389 | - if(!$message){ | ||
| 390 | - $this->output('AI文案生成失败'); | ||
| 391 | - continue; | 394 | + $error = 0; |
| 395 | + while ($error<3){ | ||
| 396 | + $message = $this->ai_send($task['ai_param'], $message); | ||
| 397 | + if(!$message){ | ||
| 398 | + $this->output('AI文案生成失败'); | ||
| 399 | + $error++; | ||
| 400 | + if($error==2){ | ||
| 401 | + $task['is_replace_text'] = 1; | ||
| 402 | + $this->output('AI文案生成失败,使用文案库'); | ||
| 403 | + } | ||
| 404 | + }else{ | ||
| 405 | + break; | ||
| 406 | + } | ||
| 392 | } | 407 | } |
| 393 | - } elseif ($task['is_replace_text'] == 1 || strlen($message) <= 4) { | 408 | + } |
| 409 | + if ($task['is_replace_text'] == 1 || strlen($message) <= 4) { | ||
| 394 | //配置文案库替换或者字符少于4个,直接替换文案 | 410 | //配置文案库替换或者字符少于4个,直接替换文案 |
| 395 | 411 | ||
| 396 | $use_ids = ReInquiryDetail::where(['re_website' => $domain])->where('status', '<>', ReInquiryDetail::STATUS_FAIL)->pluck('text_id')->toArray(); | 412 | $use_ids = ReInquiryDetail::where(['re_website' => $domain])->where('status', '<>', ReInquiryDetail::STATUS_FAIL)->pluck('text_id')->toArray(); |
| @@ -444,9 +460,6 @@ class RelayInquiry extends Command | @@ -444,9 +460,6 @@ class RelayInquiry extends Command | ||
| 444 | } | 460 | } |
| 445 | } | 461 | } |
| 446 | } | 462 | } |
| 447 | - | ||
| 448 | - $form->status = ReInquiryForm::STATUS_SUCCESS; | ||
| 449 | - $form->save(); | ||
| 450 | return true; | 463 | return true; |
| 451 | } | 464 | } |
| 452 | 465 | ||
| @@ -468,12 +481,15 @@ class RelayInquiry extends Command | @@ -468,12 +481,15 @@ class RelayInquiry extends Command | ||
| 468 | */ | 481 | */ |
| 469 | public function getAdTask($ad_id) | 482 | public function getAdTask($ad_id) |
| 470 | { | 483 | { |
| 471 | - $cache_key = 'inquiry_ads_task'; | 484 | + $cache_key = 'inquiry_ads_tasks'; |
| 472 | $ads = Cache::get($cache_key, function () use ($cache_key) { | 485 | $ads = Cache::get($cache_key, function () use ($cache_key) { |
| 473 | $ads = ReInquiryTask::where(['status' => ReInquiryTask::STATUS_OPEN])->get(['id', 'ad_id', 'num', 'target', 'is_replace_text', 'ai_param']); | 486 | $ads = ReInquiryTask::where(['status' => ReInquiryTask::STATUS_OPEN])->get(['id', 'ad_id', 'num', 'target', 'is_replace_text', 'ai_param']); |
| 474 | $array = []; | 487 | $array = []; |
| 475 | foreach ($ads as $key=>$val) { | 488 | foreach ($ads as $key=>$val) { |
| 476 | - $array[$val->ad_id] = $val; | 489 | + $ad_ids = explode(',', $val['ad_id']); |
| 490 | + foreach ($ad_ids as $ad_id){ | ||
| 491 | + $array[$ad_id][] = $val; | ||
| 492 | + } | ||
| 477 | } | 493 | } |
| 478 | if ($array) | 494 | if ($array) |
| 479 | Cache::put($cache_key, $array, 60); | 495 | Cache::put($cache_key, $array, 60); |
| @@ -584,13 +600,15 @@ class RelayInquiry extends Command | @@ -584,13 +600,15 @@ class RelayInquiry extends Command | ||
| 584 | $lang = $translateSl['texts']['sl'] ?? 'en'; | 600 | $lang = $translateSl['texts']['sl'] ?? 'en'; |
| 585 | if ($lang == 'en' || Str::contains($lang, 'zh')) { | 601 | if ($lang == 'en' || Str::contains($lang, 'zh')) { |
| 586 | $language = '英文'; | 602 | $language = '英文'; |
| 603 | + $lang = 'en'; | ||
| 587 | }else{ | 604 | }else{ |
| 588 | $language = Translate::getTls($lang); | 605 | $language = Translate::getTls($lang); |
| 589 | } | 606 | } |
| 590 | $ai_command = str_replace('{mkeywords}', Arr::random(explode("\r\n", $ai_param['mkeywords'])), $ai_command); | 607 | $ai_command = str_replace('{mkeywords}', Arr::random(explode("\r\n", $ai_param['mkeywords'])), $ai_command); |
| 591 | $ai_command = str_replace('{incontent}', Arr::random(explode("\r\n", $incontent)), $ai_command); | 608 | $ai_command = str_replace('{incontent}', Arr::random(explode("\r\n", $incontent)), $ai_command); |
| 592 | $ai_command = str_replace('{characters}', Arr::random(explode("\r\n", $ai_param['characters'])), $ai_command); | 609 | $ai_command = str_replace('{characters}', Arr::random(explode("\r\n", $ai_param['characters'])), $ai_command); |
| 593 | - $ai_command = str_replace('{language}', Arr::random(explode("\r\n", $language)), $ai_command); | 610 | +// $ai_command = str_replace('{language}', Arr::random(explode("\r\n", $language)), $ai_command); |
| 611 | + $ai_command = str_replace('{language}', '英语', $ai_command); //输出英文 后面再翻译 | ||
| 594 | $ai_command = str_replace('{inkeywords}', Arr::random(explode("\r\n", $ai_param['inkeywords'])), $ai_command); | 612 | $ai_command = str_replace('{inkeywords}', Arr::random(explode("\r\n", $ai_param['inkeywords'])), $ai_command); |
| 595 | $ai_command = str_replace('{suoxie}', Arr::random(explode("\r\n", $ai_param['suoxie'])), $ai_command); | 613 | $ai_command = str_replace('{suoxie}', Arr::random(explode("\r\n", $ai_param['suoxie'])), $ai_command); |
| 596 | //中括号里的根据概率使用 | 614 | //中括号里的根据概率使用 |
| @@ -609,8 +627,10 @@ class RelayInquiry extends Command | @@ -609,8 +627,10 @@ class RelayInquiry extends Command | ||
| 609 | } | 627 | } |
| 610 | 628 | ||
| 611 | $text = Gpt::instance()->openai_chat_qqs($ai_command); | 629 | $text = Gpt::instance()->openai_chat_qqs($ai_command); |
| 630 | + if ($lang != 'en' && !Str::contains($lang, 'zh')) { | ||
| 631 | + $text = Translate::tran($text, $lang); | ||
| 632 | + } | ||
| 612 | $this->logChannel()->info("AI询盘文案", [$ai_command, $text]); | 633 | $this->logChannel()->info("AI询盘文案", [$ai_command, $text]); |
| 613 | - $text = Common::deal_keywords($text); | ||
| 614 | return Common::deal_str($text); | 634 | return Common::deal_str($text); |
| 615 | } | 635 | } |
| 616 | 636 |
| @@ -62,7 +62,7 @@ class postInquiry extends Command | @@ -62,7 +62,7 @@ class postInquiry extends Command | ||
| 62 | if($log->status != ReInquiryDetailLog::STATUS_INIT){ | 62 | if($log->status != ReInquiryDetailLog::STATUS_INIT){ |
| 63 | continue; | 63 | continue; |
| 64 | } | 64 | } |
| 65 | - | 65 | + |
| 66 | $this->output('开始执行' . $val->id); | 66 | $this->output('开始执行' . $val->id); |
| 67 | try { | 67 | try { |
| 68 | $detail = ReInquiryDetail::find($val['detail_id']); | 68 | $detail = ReInquiryDetail::find($val['detail_id']); |
| @@ -107,7 +107,7 @@ class postInquiry extends Command | @@ -107,7 +107,7 @@ class postInquiry extends Command | ||
| 107 | $res = Http::withoutVerifying()->post($website . 'api/traffic_visit/', $data)->json(); | 107 | $res = Http::withoutVerifying()->post($website . 'api/traffic_visit/', $data)->json(); |
| 108 | if (empty($res['status']) || $res['status'] != 200) { | 108 | if (empty($res['status']) || $res['status'] != 200) { |
| 109 | $log->status = ReInquiryDetailLog::STATUS_FAIL; | 109 | $log->status = ReInquiryDetailLog::STATUS_FAIL; |
| 110 | - $log->remark = $res['message'] ?? ''; | 110 | + $log->remark = mb_substr($res['message'] ?? '', 0, 200); |
| 111 | $log->save(); | 111 | $log->save(); |
| 112 | 112 | ||
| 113 | Log::channel('inquiry_relay')->error('inquiry_relay visit error', [$res, $website . 'api/traffic_visit/',$data]); | 113 | Log::channel('inquiry_relay')->error('inquiry_relay visit error', [$res, $website . 'api/traffic_visit/',$data]); |
| @@ -135,13 +135,14 @@ class postInquiry extends Command | @@ -135,13 +135,14 @@ class postInquiry extends Command | ||
| 135 | 'user_agent' => $detail['user_agent'], | 135 | 'user_agent' => $detail['user_agent'], |
| 136 | "ip" => $detail['ip'], | 136 | "ip" => $detail['ip'], |
| 137 | ]; | 137 | ]; |
| 138 | - $res = Http::get($website . 'wp-admin/admin-ajax.php', $data)->json(); | ||
| 139 | - if($res != 200){ | 138 | + $res = Http::get($website . 'wp-admin/admin-ajax.php', $data); |
| 139 | + $status = $res->status(); | ||
| 140 | + if($status != 200){ | ||
| 140 | $log->status = ReInquiryDetailLog::STATUS_FAIL; | 141 | $log->status = ReInquiryDetailLog::STATUS_FAIL; |
| 141 | - $log->remark = $res['message'] ?? ''; | 142 | + $log->remark = mb_substr($res->body() ?? '', 0 ,200); |
| 142 | $log->save(); | 143 | $log->save(); |
| 143 | 144 | ||
| 144 | - Log::channel('inquiry_relay')->error('inquiry_relay v4|v5 visit error', [$res, $website . 'wp-admin/admin-ajax.php', $data]); | 145 | + Log::channel('inquiry_relay')->error('inquiry_relay v4|v5 visit error', [$res->body(), $website . 'wp-admin/admin-ajax.php', $data]); |
| 145 | return false; | 146 | return false; |
| 146 | } | 147 | } |
| 147 | } | 148 | } |
| @@ -170,7 +171,7 @@ class postInquiry extends Command | @@ -170,7 +171,7 @@ class postInquiry extends Command | ||
| 170 | $res = Http::withoutVerifying()->withHeaders(['User-Agent' => $detail['user_agent']])->post($website . 'api/inquiryQd/', $data)->json(); | 171 | $res = Http::withoutVerifying()->withHeaders(['User-Agent' => $detail['user_agent']])->post($website . 'api/inquiryQd/', $data)->json(); |
| 171 | if(empty($res['code']) || $res['code'] != 200){ | 172 | if(empty($res['code']) || $res['code'] != 200){ |
| 172 | $log->status = ReInquiryDetailLog::STATUS_FAIL; | 173 | $log->status = ReInquiryDetailLog::STATUS_FAIL; |
| 173 | - $log->remark = $res['message'] ?? ''; | 174 | + $log->remark = mb_substr($res['message'] ?? '', 0, 200); |
| 174 | $log->save(); | 175 | $log->save(); |
| 175 | 176 | ||
| 176 | Log::channel('inquiry_relay')->error('inquiry_relay v6 inquiry error', [$res, $website . 'api/inquiryQd/', $data]); | 177 | Log::channel('inquiry_relay')->error('inquiry_relay v6 inquiry error', [$res, $website . 'api/inquiryQd/', $data]); |
| @@ -189,17 +190,18 @@ class postInquiry extends Command | @@ -189,17 +190,18 @@ class postInquiry extends Command | ||
| 189 | 'source' => 5, | 190 | 'source' => 5, |
| 190 | ]; | 191 | ]; |
| 191 | 192 | ||
| 192 | - $res = Http::withoutVerifying()->post('https://form.globalso.com/api/external-interface/add/fa043f9cbec6b38f', $data)->json(); | 193 | + $result = Http::withoutVerifying()->post('https://form.globalso.com/api/external-interface/add/fa043f9cbec6b38f', $data); |
| 194 | + $res = $result->json(); | ||
| 193 | //兼容接口返回格式 | 195 | //兼容接口返回格式 |
| 194 | if(!empty($res['data'][0]['status'])){ | 196 | if(!empty($res['data'][0]['status'])){ |
| 195 | $res['data'][0]['code'] = $res['data'][0]['status'] == 'success' ? 200 : 400; | 197 | $res['data'][0]['code'] = $res['data'][0]['status'] == 'success' ? 200 : 400; |
| 196 | } | 198 | } |
| 197 | if(empty($res['data'][0]['code']) || !in_array($res['data'][0]['code'], [200,300])){ | 199 | if(empty($res['data'][0]['code']) || !in_array($res['data'][0]['code'], [200,300])){ |
| 198 | $log->status = ReInquiryDetailLog::STATUS_FAIL; | 200 | $log->status = ReInquiryDetailLog::STATUS_FAIL; |
| 199 | - $log->remark = $res['message'] ?? ''; | 201 | + $log->remark = mb_substr($res['message'] ?? '', 0, 200); |
| 200 | $log->save(); | 202 | $log->save(); |
| 201 | 203 | ||
| 202 | - Log::channel('inquiry_relay')->error('inquiry_relay v4|v5 inquiry error', [$res, 'https://form.globalso.com/api/external-interface/add/fa043f9cbec6b38f', $data]); | 204 | + Log::channel('inquiry_relay')->error('inquiry_relay v4|v5 inquiry error', [$result->body(), 'https://form.globalso.com/api/external-interface/add/fa043f9cbec6b38f', $data]); |
| 203 | return false; | 205 | return false; |
| 204 | } | 206 | } |
| 205 | } | 207 | } |
| @@ -117,13 +117,16 @@ class VideoTask extends Command | @@ -117,13 +117,16 @@ class VideoTask extends Command | ||
| 117 | } | 117 | } |
| 118 | $keywordInfo = $this->getKeywordImage($val->id,$task_project->project_id,$domainInfo['domain']); | 118 | $keywordInfo = $this->getKeywordImage($val->id,$task_project->project_id,$domainInfo['domain']); |
| 119 | if(!empty($keywordInfo['product_list'])){ | 119 | if(!empty($keywordInfo['product_list'])){ |
| 120 | + if(!empty($task_project->logo_img)){ | ||
| 121 | + $logo_bg['logo'] = $task_project->logo_img; | ||
| 122 | + } | ||
| 120 | $array = [ | 123 | $array = [ |
| 121 | 'project_id' => $task_project->project_id, | 124 | 'project_id' => $task_project->project_id, |
| 122 | 'keyword_id' => $val->id, | 125 | 'keyword_id' => $val->id, |
| 123 | 'keyword' => $val->title, | 126 | 'keyword' => $val->title, |
| 124 | 'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'], | 127 | 'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'], |
| 125 | 'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'], | 128 | 'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'], |
| 126 | - 'keywords' => $keywordInfo['keyword_list'], 'logo_bg' => $logo_bg]), | 129 | + 'keywords' => $keywordInfo['keyword_list'], 'logo_bg' => $logo_bg , 'template_data' => $task_project->template_data]), |
| 127 | 'status' => KeywordVideoTaskLog::STATUS_INIT, | 130 | 'status' => KeywordVideoTaskLog::STATUS_INIT, |
| 128 | 'updated_at' => date('Y-m-d H:i:s'), | 131 | 'updated_at' => date('Y-m-d H:i:s'), |
| 129 | 'created_at' => date('Y-m-d H:i:s'), | 132 | 'created_at' => date('Y-m-d H:i:s'), |
| @@ -162,7 +165,8 @@ class VideoTask extends Command | @@ -162,7 +165,8 @@ class VideoTask extends Command | ||
| 162 | 'description' => $valData['description'], | 165 | 'description' => $valData['description'], |
| 163 | 'images' => $valData['images'], | 166 | 'images' => $valData['images'], |
| 164 | 'logo'=> $valData['logo_bg']['logo'] ?? '', | 167 | 'logo'=> $valData['logo_bg']['logo'] ?? '', |
| 165 | - 'bg'=> $valData['logo_bg']['bg'] ?? '' | 168 | + 'bg'=> $valData['logo_bg']['bg'] ?? '', |
| 169 | + 'template_id'=> ((array)$valData['template_data'])['template_id'] ?? '', | ||
| 166 | ], | 170 | ], |
| 167 | 'task_id' => $task_id, | 171 | 'task_id' => $task_id, |
| 168 | 'callback_url' => env('APP_URL') . '/api/video_task_callback', | 172 | 'callback_url' => env('APP_URL') . '/api/video_task_callback', |
| @@ -56,7 +56,7 @@ class UpdateRoute extends Command | @@ -56,7 +56,7 @@ class UpdateRoute extends Command | ||
| 56 | */ | 56 | */ |
| 57 | public function handle(){ | 57 | public function handle(){ |
| 58 | $projectModel = new Project(); | 58 | $projectModel = new Project(); |
| 59 | - $list = $projectModel->list(['id'=>['in',[1750]]]); | 59 | + $list = $projectModel->list(['id'=>['in',[1653]]]); |
| 60 | $data = []; | 60 | $data = []; |
| 61 | foreach ($list as $v){ | 61 | foreach ($list as $v){ |
| 62 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 62 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| @@ -65,8 +65,8 @@ class UpdateRoute extends Command | @@ -65,8 +65,8 @@ class UpdateRoute extends Command | ||
| 65 | // $this->setProductKeyword(); | 65 | // $this->setProductKeyword(); |
| 66 | // $this->getBlog(); | 66 | // $this->getBlog(); |
| 67 | // $this->setCustomRoute($v['id']); | 67 | // $this->setCustomRoute($v['id']); |
| 68 | -// $this->editProductAlt(); | ||
| 69 | - $this->custom_to_blogs(); | 68 | + $this->editProductAlt(); |
| 69 | +// $this->custom_to_blogs(); | ||
| 70 | DB::disconnect('custom_mysql'); | 70 | DB::disconnect('custom_mysql'); |
| 71 | } | 71 | } |
| 72 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 72 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| @@ -108,17 +108,12 @@ class UpdateRoute extends Command | @@ -108,17 +108,12 @@ class UpdateRoute extends Command | ||
| 108 | 108 | ||
| 109 | public function editProductAlt(){ | 109 | public function editProductAlt(){ |
| 110 | $productModel = new Product(); | 110 | $productModel = new Product(); |
| 111 | - $lists = $productModel->list(['status'=>1],'id',['id','route','thumb','gallery']); | 111 | + $lists = $productModel->list(['status'=>1],'id',['id','route','seo_mate']); |
| 112 | foreach ($lists as $k => $v){ | 112 | foreach ($lists as $k => $v){ |
| 113 | - $v['thumb']['alt'] = $v['route']; | ||
| 114 | - if(!empty($v['gallery'])){ | ||
| 115 | - foreach ($v['gallery'] as $keys => $values){ | ||
| 116 | - $values = (array)$values; | ||
| 117 | - $values['alt'] = $v['route']; | ||
| 118 | - $v['gallery'][$keys] = $values; | ||
| 119 | - } | ||
| 120 | - } | ||
| 121 | - $productModel->edit(['thumb'=>json_encode($v['thumb'],true),'gallery'=>json_encode($v['gallery'],true)],['id'=>$v['id']]); | 113 | + $seo_mate = $v['seo_mate']; |
| 114 | + $seo_mate['title'] = ''; | ||
| 115 | + echo date('Y-m-d H:i:s') . ':'.json_encode($seo_mate) . PHP_EOL; | ||
| 116 | + $productModel->edit(['seo_mate'=>json_encode($seo_mate,true)],['id'=>$v['id']]); | ||
| 122 | } | 117 | } |
| 123 | return true; | 118 | return true; |
| 124 | } | 119 | } |
| @@ -50,7 +50,7 @@ class FormGlobalsoApi | @@ -50,7 +50,7 @@ class FormGlobalsoApi | ||
| 50 | * @author zbj | 50 | * @author zbj |
| 51 | * @date 2023/5/17 | 51 | * @date 2023/5/17 |
| 52 | */ | 52 | */ |
| 53 | - public function getInquiryList($domain, $search = '', $page = 1, $page_size = 20) | 53 | + public function getInquiryList($domain, $search = '', $page = 1, $page_size = 20, $ids = []) |
| 54 | { | 54 | { |
| 55 | $project = Project::getProjectByDomain($domain); | 55 | $project = Project::getProjectByDomain($domain); |
| 56 | $is_upgrade = $project['is_upgrade'] ??0; | 56 | $is_upgrade = $project['is_upgrade'] ??0; |
| @@ -63,6 +63,11 @@ class FormGlobalsoApi | @@ -63,6 +63,11 @@ class FormGlobalsoApi | ||
| 63 | 'page' => $page, | 63 | 'page' => $page, |
| 64 | 'source' => $is_upgrade ? '1,2,3,4' : '1,3' //来源类型 新项目用1,3 | 64 | 'source' => $is_upgrade ? '1,2,3,4' : '1,3' //来源类型 新项目用1,3 |
| 65 | ]; | 65 | ]; |
| 66 | + if($ids){ | ||
| 67 | + $params['ids'] = implode(',', $ids); | ||
| 68 | + unset($params['page']); | ||
| 69 | + unset($params['limit']); | ||
| 70 | + } | ||
| 66 | if($search){ | 71 | if($search){ |
| 67 | $params['name'] = $search; | 72 | $params['name'] = $search; |
| 68 | } | 73 | } |
| @@ -23,6 +23,9 @@ define('HTTP_OPENAI_URL', 'http://openai.waimaoq.com/'); | @@ -23,6 +23,9 @@ define('HTTP_OPENAI_URL', 'http://openai.waimaoq.com/'); | ||
| 23 | if (!function_exists('generateRoute')) { | 23 | if (!function_exists('generateRoute')) { |
| 24 | function generateRoute($string) | 24 | function generateRoute($string) |
| 25 | { | 25 | { |
| 26 | + if(is_array($string)){ | ||
| 27 | + $string = $string[0]; | ||
| 28 | + } | ||
| 26 | return str_replace(".", "", trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-')); | 29 | return str_replace(".", "", trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-')); |
| 27 | } | 30 | } |
| 28 | } | 31 | } |
| @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Api; | @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Api; | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | use App\Exceptions\InquiryFilterException; | 6 | use App\Exceptions\InquiryFilterException; |
| 7 | use App\Models\Domain\DomainInfo; | 7 | use App\Models\Domain\DomainInfo; |
| 8 | +use App\Models\Inquiry\ReInquiryCount; | ||
| 8 | use App\Models\Product\Category; | 9 | use App\Models\Product\Category; |
| 9 | use App\Models\Product\Product; | 10 | use App\Models\Product\Product; |
| 10 | use App\Models\Project\Project; | 11 | use App\Models\Project\Project; |
| @@ -142,4 +143,23 @@ class InquiryController extends BaseController | @@ -142,4 +143,23 @@ class InquiryController extends BaseController | ||
| 142 | DB::disconnect('custom_mysql'); | 143 | DB::disconnect('custom_mysql'); |
| 143 | return $this->success($data); | 144 | return $this->success($data); |
| 144 | } | 145 | } |
| 146 | + | ||
| 147 | + public function getFbInquiry(Request $request){ | ||
| 148 | + $domain = $request->input('domain', ''); | ||
| 149 | + if(!$domain){ | ||
| 150 | + return $this->error('域名必填'); | ||
| 151 | + } | ||
| 152 | + $result = ReInquiryCount::where('domain', 'like', '%'.$domain.'%')->first(); | ||
| 153 | + if($result){ | ||
| 154 | + $result->tasks = $result->tasks; //调用访问器 | ||
| 155 | + $return = 0; //所有都关闭或删除就不返回 | ||
| 156 | + foreach ($result->tasks as $task){ | ||
| 157 | + $return += (!$task['is_del'] && $task['status']); | ||
| 158 | + } | ||
| 159 | + if(!$return){ | ||
| 160 | + return $this->success([]); | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | + return $this->success($result?:[]); | ||
| 164 | + } | ||
| 145 | } | 165 | } |
| @@ -7,13 +7,14 @@ | @@ -7,13 +7,14 @@ | ||
| 7 | * @time :2024/2/26 9:23 | 7 | * @time :2024/2/26 9:23 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Http\Controllers\Aside\Com; | 10 | +namespace App\Http\Controllers\Aside\KeywordVideo; |
| 11 | 11 | ||
| 12 | use App\Enums\Common\Code; | 12 | use App\Enums\Common\Code; |
| 13 | use App\Http\Controllers\Aside\BaseController; | 13 | use App\Http\Controllers\Aside\BaseController; |
| 14 | use App\Models\Com\KeywordVideoTask; | 14 | use App\Models\Com\KeywordVideoTask; |
| 15 | use App\Models\Com\KeywordVideoTaskLog; | 15 | use App\Models\Com\KeywordVideoTaskLog; |
| 16 | use App\Models\Domain\DomainInfo; | 16 | use App\Models\Domain\DomainInfo; |
| 17 | +use Illuminate\Support\Facades\Cache; | ||
| 17 | 18 | ||
| 18 | class KeywordVideoController extends BaseController | 19 | class KeywordVideoController extends BaseController |
| 19 | { | 20 | { |
| @@ -114,6 +115,8 @@ class KeywordVideoController extends BaseController | @@ -114,6 +115,8 @@ class KeywordVideoController extends BaseController | ||
| 114 | 'status'=>$this->param['status'] ?? 0, | 115 | 'status'=>$this->param['status'] ?? 0, |
| 115 | 'sort'=>$this->param['sort'] ?? 0, | 116 | 'sort'=>$this->param['sort'] ?? 0, |
| 116 | 'keywords'=>$this->param['keywords'] ?? '', | 117 | 'keywords'=>$this->param['keywords'] ?? '', |
| 118 | + 'logo_img'=>$this->param['logo_img'] ?? '', | ||
| 119 | + 'template_data'=>isset($this->param['template_data']) ? json_encode($this->param['template_data'],true) : null | ||
| 117 | ]; | 120 | ]; |
| 118 | $rs = $keywordModel->add($data); | 121 | $rs = $keywordModel->add($data); |
| 119 | if($rs === false){ | 122 | if($rs === false){ |
| @@ -136,6 +139,9 @@ class KeywordVideoController extends BaseController | @@ -136,6 +139,9 @@ class KeywordVideoController extends BaseController | ||
| 136 | 'id.required' => '主键标识不为空', | 139 | 'id.required' => '主键标识不为空', |
| 137 | ]); | 140 | ]); |
| 138 | $keywordModel = new KeywordVideoTask(); | 141 | $keywordModel = new KeywordVideoTask(); |
| 142 | + if(isset($this->param['template_data']) && !empty($this->param['template_data'])){ | ||
| 143 | + $this->param['template_data'] = json_encode($this->param['template_data'],true); | ||
| 144 | + } | ||
| 139 | $rs = $keywordModel->edit($this->param,['id'=>$this->param['id']]); | 145 | $rs = $keywordModel->edit($this->param,['id'=>$this->param['id']]); |
| 140 | if($rs === false){ | 146 | if($rs === false){ |
| 141 | $this->response('编辑失败',Code::SYSTEM_ERROR); | 147 | $this->response('编辑失败',Code::SYSTEM_ERROR); |
| @@ -193,4 +199,27 @@ class KeywordVideoController extends BaseController | @@ -193,4 +199,27 @@ class KeywordVideoController extends BaseController | ||
| 193 | $count = $taskLogModel->formatQuery(['created_at'=>['between',[$start_of_month,$end_of_month]]])->count(); | 199 | $count = $taskLogModel->formatQuery(['created_at'=>['between',[$start_of_month,$end_of_month]]])->count(); |
| 194 | $this->response('success',Code::SUCCESS,['count'=>$count]); | 200 | $this->response('success',Code::SUCCESS,['count'=>$count]); |
| 195 | } | 201 | } |
| 202 | + | ||
| 203 | + /** | ||
| 204 | + * @remark :获取模版库模版 | ||
| 205 | + * @name :get_template | ||
| 206 | + * @author :lyh | ||
| 207 | + * @method :post | ||
| 208 | + * @time :2024/11/1 11:48 | ||
| 209 | + */ | ||
| 210 | + public function get_template(){ | ||
| 211 | + $data = Cache::get('template_data'); | ||
| 212 | + if(empty($data)){ | ||
| 213 | + $url = 'http://216.250.255.116:7866/get_template'; | ||
| 214 | + $header = [ | ||
| 215 | + 'accept: application/json' | ||
| 216 | + ]; | ||
| 217 | + $data = http_get($url,$header); | ||
| 218 | + if(!empty($data['data']) && $data['code'] == 200){ | ||
| 219 | + $data = $data['data']; | ||
| 220 | + Cache::put('template_data',$data,12 * 3600); | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + $this->response('success',Code::SUCCESS,$data); | ||
| 224 | + } | ||
| 196 | } | 225 | } |
| @@ -26,6 +26,7 @@ use App\Models\Manage\Manage; | @@ -26,6 +26,7 @@ use App\Models\Manage\Manage; | ||
| 26 | use App\Models\Manage\ManageHr; | 26 | use App\Models\Manage\ManageHr; |
| 27 | use App\Models\Project\DeployBuild; | 27 | use App\Models\Project\DeployBuild; |
| 28 | use App\Models\Project\Payment; | 28 | use App\Models\Project\Payment; |
| 29 | +use App\Models\Project\ProcessRecords; | ||
| 29 | use App\Models\Project\Project; | 30 | use App\Models\Project\Project; |
| 30 | use App\Models\Project\ProjectUpdateTdk; | 31 | use App\Models\Project\ProjectUpdateTdk; |
| 31 | use App\Models\Project\RenewLog; | 32 | use App\Models\Project\RenewLog; |
| @@ -356,6 +357,14 @@ class ProjectController extends BaseController | @@ -356,6 +357,14 @@ class ProjectController extends BaseController | ||
| 356 | if($item['type'] != Project::TYPE_ZERO){ | 357 | if($item['type'] != Project::TYPE_ZERO){ |
| 357 | $data = APublicModel::getNumByProjectId($item['id']); | 358 | $data = APublicModel::getNumByProjectId($item['id']); |
| 358 | } | 359 | } |
| 360 | + if($item['type'] == Project::TYPE_ONE){//建站中 | ||
| 361 | + $processModel = new ProcessRecords(); | ||
| 362 | + $item['sign_project'] = 0; | ||
| 363 | + $proInfo = $processModel->read(['project_id'=>$item['id'],'updated_at'=>['>=',time() - 3 * 12 * 3600]],['id']); | ||
| 364 | + if($proInfo === false){ | ||
| 365 | + $item['sign_project'] = 1; | ||
| 366 | + } | ||
| 367 | + } | ||
| 359 | $manageModel = new ManageHr(); | 368 | $manageModel = new ManageHr(); |
| 360 | $item['channel'] = Channel::getChannelText($item['channel']['user_id'] ?? 0); | 369 | $item['channel'] = Channel::getChannelText($item['channel']['user_id'] ?? 0); |
| 361 | $item['build_leader'] = $manageModel->getName($item['leader_mid']); | 370 | $item['build_leader'] = $manageModel->getName($item['leader_mid']); |
| @@ -62,7 +62,7 @@ class AdsController extends BaseController | @@ -62,7 +62,7 @@ class AdsController extends BaseController | ||
| 62 | foreach ($result as &$item){ | 62 | foreach ($result as &$item){ |
| 63 | $relay_site_total += count($item->target); | 63 | $relay_site_total += count($item->target); |
| 64 | $item->requiry_num = ReInquiryDetail::where('task_id', $item->id)->where('status', ReInquiryDetail::STATUS_SUCCESS)->count(); | 64 | $item->requiry_num = ReInquiryDetail::where('task_id', $item->id)->where('status', ReInquiryDetail::STATUS_SUCCESS)->count(); |
| 65 | - $item->form_num = ReInquiryForm::where('ad_id', $item->ad_id)->count(); | 65 | + $item->form_num = ReInquiryForm::whereIn('ad_id', explode(',', $item->ad_id))->count(); |
| 66 | } | 66 | } |
| 67 | $result = $result->toArray(); | 67 | $result = $result->toArray(); |
| 68 | $result['relay_site_total'] = $relay_site_total; | 68 | $result['relay_site_total'] = $relay_site_total; |
| @@ -169,7 +169,8 @@ class AdsController extends BaseController | @@ -169,7 +169,8 @@ class AdsController extends BaseController | ||
| 169 | if($channel){ | 169 | if($channel){ |
| 170 | $data = [ | 170 | $data = [ |
| 171 | 'is_v6' => 1, | 171 | 'is_v6' => 1, |
| 172 | - 'agent' => trim(explode('-', Channel::getChannelText($channel['user_id']??0))[0]), | 172 | + 'agent' => Channel::getChannelText($channel['user_id']??0), |
| 173 | + 'agent_group' => trim(explode('-', Channel::getChannelText($channel['user_id']??0))[0]), | ||
| 173 | 'domain' => $domain, | 174 | 'domain' => $domain, |
| 174 | ]; | 175 | ]; |
| 175 | return $this->response('success', Code::SUCCESS, $data); | 176 | return $this->response('success', Code::SUCCESS, $data); |
| @@ -180,13 +181,10 @@ class AdsController extends BaseController | @@ -180,13 +181,10 @@ class AdsController extends BaseController | ||
| 180 | return $this->response($res['msg'] ?? '验证失败,请稍后再试!', Code::USER_ERROR, []); | 181 | return $this->response($res['msg'] ?? '验证失败,请稍后再试!', Code::USER_ERROR, []); |
| 181 | } | 182 | } |
| 182 | 183 | ||
| 183 | - $agent = implode(',', array_map(function ($v){ | ||
| 184 | - return trim(explode('-', $v)[0]); | ||
| 185 | - }, explode(',', $res['data'] ?? ''))); | ||
| 186 | - | ||
| 187 | $data = [ | 184 | $data = [ |
| 188 | 'is_v6' => 0, | 185 | 'is_v6' => 0, |
| 189 | - 'agent' => $agent, | 186 | + 'agent' => $res['data'], |
| 187 | + 'agent_group' => trim(explode('-', explode(',', $res['data'] ?? '')[0])[0]), | ||
| 190 | 'domain' => $domain, | 188 | 'domain' => $domain, |
| 191 | ]; | 189 | ]; |
| 192 | return $this->response('success', Code::SUCCESS, $data); | 190 | return $this->response('success', Code::SUCCESS, $data); |
| @@ -233,6 +231,7 @@ class AdsController extends BaseController | @@ -233,6 +231,7 @@ class AdsController extends BaseController | ||
| 233 | $task_id = intval($request->input('task_id')); | 231 | $task_id = intval($request->input('task_id')); |
| 234 | $form_id = intval($request->input('form_id')); | 232 | $form_id = intval($request->input('form_id')); |
| 235 | $country = intval($request->input('country')); | 233 | $country = intval($request->input('country')); |
| 234 | + $page_size = intval($request->input('row', '20')); | ||
| 236 | $result = ReInquiryDetail::with('detailLog') | 235 | $result = ReInquiryDetail::with('detailLog') |
| 237 | ->when($status, function ($query, $status) { | 236 | ->when($status, function ($query, $status) { |
| 238 | return $query->where('status', $status); | 237 | return $query->where('status', $status); |
| @@ -247,7 +246,7 @@ class AdsController extends BaseController | @@ -247,7 +246,7 @@ class AdsController extends BaseController | ||
| 247 | return $query->where('country', 'like', '%'.$country.'%'); | 246 | return $query->where('country', 'like', '%'.$country.'%'); |
| 248 | }) | 247 | }) |
| 249 | ->orderBy('id', 'desc') | 248 | ->orderBy('id', 'desc') |
| 250 | - ->paginate(); | 249 | + ->paginate($page_size); |
| 251 | return $this->response('success', Code::SUCCESS, $result); | 250 | return $this->response('success', Code::SUCCESS, $result); |
| 252 | } | 251 | } |
| 253 | 252 | ||
| @@ -274,8 +273,9 @@ class AdsController extends BaseController | @@ -274,8 +273,9 @@ class AdsController extends BaseController | ||
| 274 | ->orderBy('num', 'desc') | 273 | ->orderBy('num', 'desc') |
| 275 | ->paginate($row); | 274 | ->paginate($row); |
| 276 | 275 | ||
| 277 | - foreach ($result as $item){ | 276 | + foreach ($result as &$item){ |
| 278 | $item->tasks = $item->tasks; //调用访问器 | 277 | $item->tasks = $item->tasks; //调用访问器 |
| 278 | + $item['project_id'] = DomainInfo::where('domain', $item['domain'])->value('project_id') ?: 0; | ||
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | return $this->response('success', Code::SUCCESS, $result); | 281 | return $this->response('success', Code::SUCCESS, $result); |
| @@ -404,7 +404,8 @@ class ComController extends BaseController | @@ -404,7 +404,8 @@ class ComController extends BaseController | ||
| 404 | * @time :2024/10/28 11:51 | 404 | * @time :2024/10/28 11:51 |
| 405 | */ | 405 | */ |
| 406 | public function month_counts(){ | 406 | public function month_counts(){ |
| 407 | - Artisan::call('month_project '.$this->user['project_id']); | 407 | + shell_exec('php artisan month_project '.$this->user['project_id']); |
| 408 | +// Artisan::call('month_project '.$this->user['project_id']); | ||
| 408 | $this->response('重新刷新中,请稍后刷新查询'); | 409 | $this->response('重新刷新中,请稍后刷新查询'); |
| 409 | } | 410 | } |
| 410 | } | 411 | } |
| @@ -32,6 +32,9 @@ class CustomModuleCategoryController extends BaseController | @@ -32,6 +32,9 @@ class CustomModuleCategoryController extends BaseController | ||
| 32 | ],[ | 32 | ],[ |
| 33 | 'module_id.required' => 'module_id不能为空', | 33 | 'module_id.required' => 'module_id不能为空', |
| 34 | ]); | 34 | ]); |
| 35 | + //获取模块路由 | ||
| 36 | + $customModuleModel = new CustomModule(); | ||
| 37 | + $moduleInfo = $customModuleModel->read(['id'=>$this->param['module_id']]); | ||
| 35 | $this->map['project_id'] = $this->user['project_id']; | 38 | $this->map['project_id'] = $this->user['project_id']; |
| 36 | $this->map['status'] = 0; | 39 | $this->map['status'] = 0; |
| 37 | $list = $customModuleCategory->list($this->map,'sort'); | 40 | $list = $customModuleCategory->list($this->map,'sort'); |
| @@ -40,6 +43,11 @@ class CustomModuleCategoryController extends BaseController | @@ -40,6 +43,11 @@ class CustomModuleCategoryController extends BaseController | ||
| 40 | foreach ($list as $k => $v){ | 43 | foreach ($list as $k => $v){ |
| 41 | $v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_LIST,$template_id,$v['id'],BTemplate::IS_CUSTOM); | 44 | $v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_LIST,$template_id,$v['id'],BTemplate::IS_CUSTOM); |
| 42 | $v['url'] = $this->user['domain'].$v['route']; | 45 | $v['url'] = $this->user['domain'].$v['route']; |
| 46 | + if($this->user['is_upgrade'] == 1){ | ||
| 47 | + if($v['route'] != $moduleInfo['route']){ | ||
| 48 | + $v['url'] = $this->user['domain'].$moduleInfo['route']."_catalog/".$v['route']; | ||
| 49 | + } | ||
| 50 | + } | ||
| 43 | $list[$k] = $v; | 51 | $list[$k] = $v; |
| 44 | } | 52 | } |
| 45 | } | 53 | } |
| @@ -135,7 +135,7 @@ class InquiryController extends BaseController | @@ -135,7 +135,7 @@ class InquiryController extends BaseController | ||
| 135 | { | 135 | { |
| 136 | if(!empty($this->param['form_id'])){ | 136 | if(!empty($this->param['form_id'])){ |
| 137 | $data = $logic->getFormDataList(true); | 137 | $data = $logic->getFormDataList(true); |
| 138 | - $field = InquiryForm::getField($this->param['form_id']); | 138 | + $field = InquiryForm::getField($this->param['form_id'], $this->user['project_id']); |
| 139 | $map = [ | 139 | $map = [ |
| 140 | 'submit_time' => '询盘发送时间', | 140 | 'submit_time' => '询盘发送时间', |
| 141 | ]; | 141 | ]; |
| @@ -168,10 +168,10 @@ class InquiryController extends BaseController | @@ -168,10 +168,10 @@ class InquiryController extends BaseController | ||
| 168 | $data = $data['list'] ?? []; | 168 | $data = $data['list'] ?? []; |
| 169 | foreach ($data as &$item){ | 169 | foreach ($data as &$item){ |
| 170 | //非正常登录的 | 170 | //非正常登录的 |
| 171 | - if($this->param['login_source'] != 2){ | 171 | + if($this->param['login_source']??0 != 2){ |
| 172 | //脱敏 | 172 | //脱敏 |
| 173 | - $item['email'] = email_desensitize($item['email']); | ||
| 174 | - $item['phone'] = substr($item['phone'], 0, -4) . '****'; | 173 | + !empty($item['email']) && $item['email'] = email_desensitize($item['email']); |
| 174 | + !empty($item['phone']) && $item['phone'] = substr($item['phone'], 0, -4) . '****'; | ||
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | $item['ip_address'] = "{$item['country']}({$item['ip']})"; | 177 | $item['ip_address'] = "{$item['country']}({$item['ip']})"; |
| @@ -179,8 +179,11 @@ class InquiryController extends BaseController | @@ -179,8 +179,11 @@ class InquiryController extends BaseController | ||
| 179 | if(!empty($this->param['form_id'])){ | 179 | if(!empty($this->param['form_id'])){ |
| 180 | $item = array_merge($item, $item['data']); | 180 | $item = array_merge($item, $item['data']); |
| 181 | } | 181 | } |
| 182 | - | ||
| 183 | foreach ($map as $field => $name) { | 182 | foreach ($map as $field => $name) { |
| 183 | + if(empty($item[$field])){ | ||
| 184 | + $item[$field] = ''; | ||
| 185 | + continue; | ||
| 186 | + } | ||
| 184 | if(is_array($item[$field])){ | 187 | if(is_array($item[$field])){ |
| 185 | $item[$field] = implode(',',$item[$field]); | 188 | $item[$field] = implode(',',$item[$field]); |
| 186 | } | 189 | } |
| @@ -152,7 +152,10 @@ class LoginController extends BaseController | @@ -152,7 +152,10 @@ class LoginController extends BaseController | ||
| 152 | ],[ | 152 | ],[ |
| 153 | 'str.required' => '翻译字符串不能为空', | 153 | 'str.required' => '翻译字符串不能为空', |
| 154 | ]); | 154 | ]); |
| 155 | - $str = Translate::tran($this->param['str'], 'en'); | 155 | + $str = Translate::tran($this->param['str'], 'en') ?? ''; |
| 156 | + if(is_array($str)){ | ||
| 157 | + $str = $str[0]; | ||
| 158 | + } | ||
| 156 | $this->response('success',Code::SUCCESS,strtolower($str)); | 159 | $this->response('success',Code::SUCCESS,strtolower($str)); |
| 157 | } | 160 | } |
| 158 | 161 |
此 diff 太大无法显示。
| @@ -96,6 +96,7 @@ class ProjectLogic extends BaseLogic | @@ -96,6 +96,7 @@ class ProjectLogic extends BaseLogic | ||
| 96 | if(isset($info['deploy_build']['other_project']) && !empty($info['deploy_build']['other_project'])){ | 96 | if(isset($info['deploy_build']['other_project']) && !empty($info['deploy_build']['other_project'])){ |
| 97 | $info['deploy_build']['other_project']= json_decode($info['deploy_build']['other_project']); | 97 | $info['deploy_build']['other_project']= json_decode($info['deploy_build']['other_project']); |
| 98 | } | 98 | } |
| 99 | + //is_product:"0",is_news:"0",is_blogs:"0",is_module:"0" | ||
| 99 | //获取小语种 | 100 | //获取小语种 |
| 100 | $info['minor_languages'] = $this->getProjectMinorLanguages($id); | 101 | $info['minor_languages'] = $this->getProjectMinorLanguages($id); |
| 101 | //升级项目采集完成时间 | 102 | //升级项目采集完成时间 |
| @@ -40,10 +40,11 @@ class InquiryLogic extends BaseLogic | @@ -40,10 +40,11 @@ class InquiryLogic extends BaseLogic | ||
| 40 | } | 40 | } |
| 41 | $search = $this->request['search'] ?: ''; | 41 | $search = $this->request['search'] ?: ''; |
| 42 | $page = $this->request['page'] ?: 1; | 42 | $page = $this->request['page'] ?: 1; |
| 43 | + $ids = $this->request['ids'] ?: []; | ||
| 43 | $project = (new ProjectLogic())->getProjectInfo($this->user['project_id']); | 44 | $project = (new ProjectLogic())->getProjectInfo($this->user['project_id']); |
| 44 | $domain = (!empty( | 45 | $domain = (!empty( |
| 45 | $project['deploy_optimize']['domain']) ? ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ''); | 46 | $project['deploy_optimize']['domain']) ? ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ''); |
| 46 | - $list = $this->form_globalso_api->getInquiryList($domain, $search, $page, $page_size); | 47 | + $list = $this->form_globalso_api->getInquiryList($domain, $search, $page, $page_size, $ids); |
| 47 | //处理格式 免得前端又改 | 48 | //处理格式 免得前端又改 |
| 48 | $data = [ | 49 | $data = [ |
| 49 | "list" => [], | 50 | "list" => [], |
| @@ -66,10 +67,14 @@ class InquiryLogic extends BaseLogic | @@ -66,10 +67,14 @@ class InquiryLogic extends BaseLogic | ||
| 66 | $page_size = $export ? 1000 : 20; | 67 | $page_size = $export ? 1000 : 20; |
| 67 | $search = $this->request['search'] ?: ''; | 68 | $search = $this->request['search'] ?: ''; |
| 68 | $page = $this->request['page'] ?: 1; | 69 | $page = $this->request['page'] ?: 1; |
| 70 | + $ids = $this->request['ids'] ?? []; | ||
| 69 | $map = []; | 71 | $map = []; |
| 70 | if($search){ | 72 | if($search){ |
| 71 | $map['email'] = ['like','%'.$search.'%']; | 73 | $map['email'] = ['like','%'.$search.'%']; |
| 72 | } | 74 | } |
| 75 | + if ($ids) { | ||
| 76 | + $map['id'] = ['in', $ids]; | ||
| 77 | + } | ||
| 73 | 78 | ||
| 74 | $data = (new InquiryOther())->lists($map,$page,$page_size,'id', | 79 | $data = (new InquiryOther())->lists($map,$page,$page_size,'id', |
| 75 | ['id', 'email', 'ip', 'country', 'domain', DB::raw('referer as refer'), DB::raw('status as read_status'), 'submit_time'] | 80 | ['id', 'email', 'ip', 'country', 'domain', DB::raw('referer as refer'), DB::raw('status as read_status'), 'submit_time'] |
| @@ -83,15 +88,19 @@ class InquiryLogic extends BaseLogic | @@ -83,15 +88,19 @@ class InquiryLogic extends BaseLogic | ||
| 83 | $search = $this->request['search'] ?: ''; | 88 | $search = $this->request['search'] ?: ''; |
| 84 | $page = $this->request['page'] ?: 1; | 89 | $page = $this->request['page'] ?: 1; |
| 85 | $form_id = $this->request['form_id'] ?? ''; | 90 | $form_id = $this->request['form_id'] ?? ''; |
| 86 | - $field = InquiryForm::getField($form_id); | 91 | + $ids = $this->request['ids'] ?? []; |
| 92 | + $field = InquiryForm::getField($form_id, $this->user['project_id']); | ||
| 87 | $fields = ['id', 'data', 'ip', 'country', 'domain', DB::raw('referer as refer'), DB::raw('status as read_status'), DB::raw('submit_at as submit_time')]; | 93 | $fields = ['id', 'data', 'ip', 'country', 'domain', DB::raw('referer as refer'), DB::raw('status as read_status'), DB::raw('submit_at as submit_time')]; |
| 88 | $lists = InquiryFormData::where('form_id', $form_id) | 94 | $lists = InquiryFormData::where('form_id', $form_id) |
| 89 | - ->where(function ($query) use ($search, $field){ | 95 | + ->where(function ($query) use ($search, $field,$ids){ |
| 90 | if($search){ | 96 | if($search){ |
| 91 | foreach ($field as $v){ | 97 | foreach ($field as $v){ |
| 92 | $query->orWhere('data->' . $v, $search); | 98 | $query->orWhere('data->' . $v, $search); |
| 93 | } | 99 | } |
| 94 | } | 100 | } |
| 101 | + if($ids){ | ||
| 102 | + $query->whereIn('ids', $ids); | ||
| 103 | + } | ||
| 95 | }) | 104 | }) |
| 96 | ->select($fields)->orderBy('id', 'desc')->paginate($page_size, ['*'], 'page', $page); | 105 | ->select($fields)->orderBy('id', 'desc')->paginate($page_size, ['*'], 'page', $page); |
| 97 | $data = $lists->toArray(); | 106 | $data = $lists->toArray(); |
| @@ -190,7 +199,7 @@ class InquiryLogic extends BaseLogic | @@ -190,7 +199,7 @@ class InquiryLogic extends BaseLogic | ||
| 190 | if($data === false){ | 199 | if($data === false){ |
| 191 | $url = 'https://fob.ai.cc/api/mobile_verify_data/'.$num_phone; | 200 | $url = 'https://fob.ai.cc/api/mobile_verify_data/'.$num_phone; |
| 192 | $data = http_get($url); | 201 | $data = http_get($url); |
| 193 | - if(!empty($data)){ | 202 | + if(!empty($data) && ((strpos($data['wa_profile_pic'], 'pps.whatsapp.net') === false))){ |
| 194 | $param = [ | 203 | $param = [ |
| 195 | 'phone'=>$phone, | 204 | 'phone'=>$phone, |
| 196 | 'num_phone'=>$num_phone, | 205 | 'num_phone'=>$num_phone, |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace App\Http\Logic\Bside\News; | 3 | namespace App\Http\Logic\Bside\News; |
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | +use App\Helper\Arr; | ||
| 6 | use App\Http\Logic\Bside\BaseLogic; | 7 | use App\Http\Logic\Bside\BaseLogic; |
| 7 | use App\Models\News\News; | 8 | use App\Models\News\News; |
| 8 | use App\Models\News\NewsCategory; | 9 | use App\Models\News\NewsCategory; |
| @@ -185,9 +186,7 @@ class NewsLogic extends BaseLogic | @@ -185,9 +186,7 @@ class NewsLogic extends BaseLogic | ||
| 185 | if(isset($param['image'])){ | 186 | if(isset($param['image'])){ |
| 186 | $param['image'] = str_replace_url($param['image'] ?? ''); | 187 | $param['image'] = str_replace_url($param['image'] ?? ''); |
| 187 | } | 188 | } |
| 188 | - if(isset($param['related_news_id'])){ | ||
| 189 | - $param['related_news_id'] = implode(',',$param['related_news_id']); | ||
| 190 | - } | 189 | + |
| 191 | if(isset($this->param['id'])){ | 190 | if(isset($this->param['id'])){ |
| 192 | $param['operator_id'] = $this->user['id']; | 191 | $param['operator_id'] = $this->user['id']; |
| 193 | }else{ | 192 | }else{ |
| @@ -204,6 +203,9 @@ class NewsLogic extends BaseLogic | @@ -204,6 +203,9 @@ class NewsLogic extends BaseLogic | ||
| 204 | $this->fail('发布时间需大于当天'); | 203 | $this->fail('发布时间需大于当天'); |
| 205 | } | 204 | } |
| 206 | } | 205 | } |
| 206 | + if(isset($param['related_news_id'])){ | ||
| 207 | + $param['related_news_id'] = implode(',',$param['related_news_id']); | ||
| 208 | + } | ||
| 207 | return $this->success($param); | 209 | return $this->success($param); |
| 208 | } | 210 | } |
| 209 | 211 |
| @@ -185,6 +185,7 @@ class UserLoginLogic | @@ -185,6 +185,7 @@ class UserLoginLogic | ||
| 185 | $info['open_export_product'] = $project['open_export_product']; | 185 | $info['open_export_product'] = $project['open_export_product']; |
| 186 | $info['is_update_language'] = $project['is_update_language']; | 186 | $info['is_update_language'] = $project['is_update_language']; |
| 187 | $info['is_watermark'] = $project['is_watermark']; | 187 | $info['is_watermark'] = $project['is_watermark']; |
| 188 | + $project['deploy_build']['configuration']['is_product'] = $project['deploy_build']['configuration']['is_news'] = $project['deploy_build']['configuration']['is_blogs'] = $project['deploy_build']['configuration']['is_module'] = "1"; | ||
| 188 | $info['configuration'] = $project['deploy_build']['configuration']; | 189 | $info['configuration'] = $project['deploy_build']['configuration']; |
| 189 | $info['file_cdn'] = $project['deploy_build']['file_cdn']; | 190 | $info['file_cdn'] = $project['deploy_build']['file_cdn']; |
| 190 | $info['project_type'] = $project['type']; | 191 | $info['project_type'] = $project['type']; |
| @@ -292,6 +293,7 @@ class UserLoginLogic | @@ -292,6 +293,7 @@ class UserLoginLogic | ||
| 292 | $info['uptime'] = $project['uptime']; | 293 | $info['uptime'] = $project['uptime']; |
| 293 | $info['is_update_language'] = $project['is_update_language']; | 294 | $info['is_update_language'] = $project['is_update_language']; |
| 294 | $info['is_watermark'] = $project['is_watermark']; | 295 | $info['is_watermark'] = $project['is_watermark']; |
| 296 | + $project['deploy_build']['configuration']['is_product'] = $project['deploy_build']['configuration']['is_news'] = $project['deploy_build']['configuration']['is_blogs'] = $project['deploy_build']['configuration']['is_module'] = "1"; | ||
| 295 | $info['configuration'] = $project['deploy_build']['configuration']; | 297 | $info['configuration'] = $project['deploy_build']['configuration']; |
| 296 | $info['project_type'] = $project['type']; | 298 | $info['project_type'] = $project['type']; |
| 297 | $info['storage_type'] = $project['storage_type']; | 299 | $info['storage_type'] = $project['storage_type']; |
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | 9 | ||
| 10 | namespace App\Models\Com; | 10 | namespace App\Models\Com; |
| 11 | 11 | ||
| 12 | +use App\Helper\Arr; | ||
| 12 | use App\Models\Base; | 13 | use App\Models\Base; |
| 13 | 14 | ||
| 14 | class KeywordVideoTask extends Base | 15 | class KeywordVideoTask extends Base |
| @@ -17,4 +18,10 @@ class KeywordVideoTask extends Base | @@ -17,4 +18,10 @@ class KeywordVideoTask extends Base | ||
| 17 | const STATUS_CLOSE = 1;//停止 | 18 | const STATUS_CLOSE = 1;//停止 |
| 18 | 19 | ||
| 19 | protected $table = 'gl_keyword_video_task'; | 20 | protected $table = 'gl_keyword_video_task'; |
| 21 | + | ||
| 22 | + public function getTemplateDataAttribute($value) | ||
| 23 | + { | ||
| 24 | + $value = Arr::s2a($value); | ||
| 25 | + return $value; | ||
| 26 | + } | ||
| 20 | } | 27 | } |
| @@ -50,8 +50,8 @@ class InquiryForm extends Base | @@ -50,8 +50,8 @@ class InquiryForm extends Base | ||
| 50 | * @author zbj | 50 | * @author zbj |
| 51 | * @date 2023/12/5 | 51 | * @date 2023/12/5 |
| 52 | */ | 52 | */ |
| 53 | - public static function getField($form_id){ | ||
| 54 | - $cache_key = 'inquiry_form_field_' . $form_id; | 53 | + public static function getField($form_id, $project_id){ |
| 54 | + $cache_key = 'inquiry_form_field_' . $project_id . '_' . $form_id; | ||
| 55 | $field = Cache::get($cache_key); | 55 | $field = Cache::get($cache_key); |
| 56 | if(!$field){ | 56 | if(!$field){ |
| 57 | $field = self::where('id', $form_id)->value('field'); | 57 | $field = self::where('id', $form_id)->value('field'); |
| @@ -4,6 +4,7 @@ namespace App\Models\Inquiry; | @@ -4,6 +4,7 @@ namespace App\Models\Inquiry; | ||
| 4 | 4 | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | use App\Helper\QuanqiusouApi; | 6 | use App\Helper\QuanqiusouApi; |
| 7 | +use App\Models\Base; | ||
| 7 | use App\Models\Domain\DomainInfo; | 8 | use App\Models\Domain\DomainInfo; |
| 8 | use App\Models\Project\Project; | 9 | use App\Models\Project\Project; |
| 9 | use App\Models\Task\TaskOwner; | 10 | use App\Models\Task\TaskOwner; |
| @@ -15,7 +16,7 @@ use Illuminate\Database\Eloquent\Model; | @@ -15,7 +16,7 @@ use Illuminate\Database\Eloquent\Model; | ||
| 15 | * @author zbj | 16 | * @author zbj |
| 16 | * @date 2024/10/25 | 17 | * @date 2024/10/25 |
| 17 | */ | 18 | */ |
| 18 | -class ReInquiryCount extends Model | 19 | +class ReInquiryCount extends Base |
| 19 | { | 20 | { |
| 20 | /** | 21 | /** |
| 21 | * @var string | 22 | * @var string |
| @@ -66,9 +67,10 @@ class ReInquiryCount extends Model | @@ -66,9 +67,10 @@ class ReInquiryCount extends Model | ||
| 66 | } | 67 | } |
| 67 | 68 | ||
| 68 | public function getTasksAttribute(){ | 69 | public function getTasksAttribute(){ |
| 69 | - $tasks = ReInquiryTask::whereIn('id', $this->task_ids)->select(['title', 'industry','target'])->get()->toArray(); | 70 | + $tasks = ReInquiryTask::whereIn('id', $this->task_ids)->select(['title', 'industry','target', 'status'])->get()->toArray(); |
| 70 | foreach ($tasks as &$task){ | 71 | foreach ($tasks as &$task){ |
| 71 | $target = collect($task['target'])->where('url', $this->domain)->first(); | 72 | $target = collect($task['target'])->where('url', $this->domain)->first(); |
| 73 | + $task['is_del'] = $target ? 0 : 1; | ||
| 72 | $task['agent'] = $target['agent'] ?? ''; | 74 | $task['agent'] = $target['agent'] ?? ''; |
| 73 | $task['is_v6'] = $target['is_v6'] ?? ''; | 75 | $task['is_v6'] = $target['is_v6'] ?? ''; |
| 74 | $task['agent_group'] = $target['agent_group'] ?? ''; | 76 | $task['agent_group'] = $target['agent_group'] ?? ''; |
| @@ -28,6 +28,7 @@ Route::post('inquiry_submit', [\App\Http\Controllers\Api\InquiryController::clas | @@ -28,6 +28,7 @@ Route::post('inquiry_submit', [\App\Http\Controllers\Api\InquiryController::clas | ||
| 28 | Route::post('editInquiryStatus', [\App\Http\Controllers\Api\InquiryController::class, 'editInquiryStatus'])->name('api.inquiry_editInquiryStatus'); | 28 | Route::post('editInquiryStatus', [\App\Http\Controllers\Api\InquiryController::class, 'editInquiryStatus'])->name('api.inquiry_editInquiryStatus'); |
| 29 | Route::any('get_inquiry_random_ip', [\App\Http\Controllers\Api\InquiryController::class, 'getRandomIp'])->name('api.inquiry_getRandomIp'); | 29 | Route::any('get_inquiry_random_ip', [\App\Http\Controllers\Api\InquiryController::class, 'getRandomIp'])->name('api.inquiry_getRandomIp'); |
| 30 | Route::any('get_visit_url', [\App\Http\Controllers\Api\InquiryController::class, 'getVisitUrl'])->name('api.inquiry_getVisitUrl'); | 30 | Route::any('get_visit_url', [\App\Http\Controllers\Api\InquiryController::class, 'getVisitUrl'])->name('api.inquiry_getVisitUrl'); |
| 31 | +Route::any('get_fb_inquiry', [\App\Http\Controllers\Api\InquiryController::class, 'getFbInquiry'])->name('api.fb_inquiry'); | ||
| 31 | Route::any('getOptimizationReport', [\App\Http\Controllers\Api\OptimizationReportController::class, 'getOptimizationReport'])->name('api.getOptimizationReport'); | 32 | Route::any('getOptimizationReport', [\App\Http\Controllers\Api\OptimizationReportController::class, 'getOptimizationReport'])->name('api.getOptimizationReport'); |
| 32 | // 视频任务回调信息 | 33 | // 视频任务回调信息 |
| 33 | Route::post('video_task_callback', [\App\Http\Controllers\Api\NoticeController::class, 'videoTaskCallback'])->name('api.video_task_callback'); | 34 | Route::post('video_task_callback', [\App\Http\Controllers\Api\NoticeController::class, 'videoTaskCallback'])->name('api.video_task_callback'); |
| @@ -348,12 +348,13 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -348,12 +348,13 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 348 | * 生成视频的项目 | 348 | * 生成视频的项目 |
| 349 | */ | 349 | */ |
| 350 | Route::prefix('keyword_video')->group(function () { | 350 | Route::prefix('keyword_video')->group(function () { |
| 351 | - Route::any('/', [Aside\Com\KeywordVideoController::class, 'lists'])->name('keyword_video_lists'); | ||
| 352 | - Route::any('/createKeywordTask', [Aside\Com\KeywordVideoController::class, 'createKeywordTask'])->name('keyword_video_createKeywordTask'); | ||
| 353 | - Route::any('/edit', [Aside\Com\KeywordVideoController::class, 'edit'])->name('keyword_video_edit'); | ||
| 354 | - Route::any('/getVideoTaskLog', [Aside\Com\KeywordVideoController::class, 'getVideoTaskLog'])->name('keyword_video_getVideoTaskLog'); | ||
| 355 | - Route::any('/taskNum', [Aside\Com\KeywordVideoController::class, 'taskNum'])->name('keyword_video_taskNum'); | ||
| 356 | - Route::any('/getVideoCount', [Aside\Com\KeywordVideoController::class, 'getVideoCount'])->name('keyword_video_getVideoCount'); | 351 | + Route::any('/', [Aside\KeywordVideo\KeywordVideoController::class, 'lists'])->name('keyword_video_lists'); |
| 352 | + Route::any('/createKeywordTask', [Aside\KeywordVideo\KeywordVideoController::class, 'createKeywordTask'])->name('keyword_video_createKeywordTask'); | ||
| 353 | + Route::any('/edit', [Aside\KeywordVideo\KeywordVideoController::class, 'edit'])->name('keyword_video_edit'); | ||
| 354 | + Route::any('/getVideoTaskLog', [Aside\KeywordVideo\KeywordVideoController::class, 'getVideoTaskLog'])->name('keyword_video_getVideoTaskLog'); | ||
| 355 | + Route::any('/taskNum', [Aside\KeywordVideo\KeywordVideoController::class, 'taskNum'])->name('keyword_video_taskNum'); | ||
| 356 | + Route::any('/getVideoCount', [Aside\KeywordVideo\KeywordVideoController::class, 'getVideoCount'])->name('keyword_video_getVideoCount'); | ||
| 357 | + Route::any('/get_template', [Aside\KeywordVideo\KeywordVideoController::class, 'get_template'])->name('keyword_get_template'); | ||
| 357 | }); | 358 | }); |
| 358 | 359 | ||
| 359 | // 公共主题模版 | 360 | // 公共主题模版 |
| @@ -638,7 +638,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -638,7 +638,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 638 | Route::group([], function () { | 638 | Route::group([], function () { |
| 639 | Route::any('/login', [\App\Http\Controllers\Bside\LoginController::class, 'login'])->name('login'); | 639 | Route::any('/login', [\App\Http\Controllers\Bside\LoginController::class, 'login'])->name('login'); |
| 640 | Route::any('/projectLogin', [\App\Http\Controllers\Bside\LoginController::class, 'projectLogin'])->name('projectLogin'); | 640 | Route::any('/projectLogin', [\App\Http\Controllers\Bside\LoginController::class, 'projectLogin'])->name('projectLogin'); |
| 641 | - Route::any('/ceshi', [\App\Http\Controllers\Bside\LoginController::class, 'ceshi'])->name('ceshi'); | 641 | + Route::any('/ceshi', [\App\Http\Controllers\Bside\TestController::class, 'ceshi'])->name('ceshi'); |
| 642 | Route::any('/file_manager_downLoad', [\App\Http\Controllers\Bside\FileManage\FileManageController::class, 'downLoad'])->name('file_manager_downLoad'); | 642 | Route::any('/file_manager_downLoad', [\App\Http\Controllers\Bside\FileManage\FileManageController::class, 'downLoad'])->name('file_manager_downLoad'); |
| 643 | Route::any('/stringTranslation', [\App\Http\Controllers\Bside\LoginController::class, 'stringTranslation'])->name('stringTranslation'); | 643 | Route::any('/stringTranslation', [\App\Http\Controllers\Bside\LoginController::class, 'stringTranslation'])->name('stringTranslation'); |
| 644 | Route::any('/sendLoginSms', [\App\Http\Controllers\Bside\LoginController::class, 'sendLoginSms'])->name('sendLoginSms'); | 644 | Route::any('/sendLoginSms', [\App\Http\Controllers\Bside\LoginController::class, 'sendLoginSms'])->name('sendLoginSms'); |
-
请 注册 或 登录 后发表评论