作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -11,6 +11,7 @@ namespace App\Console\Commands\MonthlyCount; @@ -11,6 +11,7 @@ namespace App\Console\Commands\MonthlyCount;
11 11
12 use App\Helper\FormGlobalsoApi; 12 use App\Helper\FormGlobalsoApi;
13 use App\Models\Com\UpdateOldInfo; 13 use App\Models\Com\UpdateOldInfo;
  14 +use App\Models\Domain\DomainInfo;
14 use App\Models\HomeCount\MonthCount; 15 use App\Models\HomeCount\MonthCount;
15 use App\Models\Project\Project; 16 use App\Models\Project\Project;
16 use App\Models\Visit\Visit; 17 use App\Models\Visit\Visit;
@@ -39,7 +40,13 @@ class UpgradeProjectCount extends Command @@ -39,7 +40,13 @@ class UpgradeProjectCount extends Command
39 $project_id = $this->argument('project_id'); 40 $project_id = $this->argument('project_id');
40 $oldModel = new UpdateOldInfo(); 41 $oldModel = new UpdateOldInfo();
41 $info = $oldModel->read(['project_id'=>$project_id]); 42 $info = $oldModel->read(['project_id'=>$project_id]);
42 - $url = $info['old_domain_online']; 43 + if($info !== false){
  44 + $url = $info['old_domain_online'];
  45 + }else{
  46 + $domainModel = new DomainInfo();
  47 + $info = $domainModel->read(['project_id'=>$project_id]);
  48 + $url = $info['domain'];
  49 + }
43 ProjectServer::useProject($project_id); 50 ProjectServer::useProject($project_id);
44 $this->count($project_id,$url); 51 $this->count($project_id,$url);
45 DB::disconnect('custom_mysql'); 52 DB::disconnect('custom_mysql');
@@ -9,7 +9,9 @@ @@ -9,7 +9,9 @@
9 9
10 namespace App\Http\Controllers\Aside\Com; 10 namespace App\Http\Controllers\Aside\Com;
11 11
  12 +use App\Enums\Common\Code;
12 use App\Http\Controllers\Aside\BaseController; 13 use App\Http\Controllers\Aside\BaseController;
  14 +use App\Models\Com\PromotionKeyword;
13 15
14 class KeywordController extends BaseController 16 class KeywordController extends BaseController
15 { 17 {
@@ -20,19 +22,19 @@ class KeywordController extends BaseController @@ -20,19 +22,19 @@ class KeywordController extends BaseController
20 * @method :post 22 * @method :post
21 * @time :2024/2/26 9:24 23 * @time :2024/2/26 9:24
22 */ 24 */
23 - public function savePromotionKeyword(){ 25 + public function createKeywordTask(){
24 $this->request->validate([ 26 $this->request->validate([
25 - 'data' => 'required|array',  
26 'project_id'=>'required', 27 'project_id'=>'required',
  28 + 'number'=>'required'
27 ], [ 29 ], [
28 - 'data.required' => '自定义询盘数据不为空',  
29 - 'data.array' => '必须为数组',  
30 'project_id.required' => '项目唯一标识不为空', 30 'project_id.required' => '项目唯一标识不为空',
  31 + 'number.required' => 'number不为空',
31 ]); 32 ]);
32 - foreach ($this->param['data'] as $v){  
33 - $param['keyword'] = $v;  
34 - $param['project_id'] = $this->param['project_id'];  
35 - 33 + $keywordModel = new PromotionKeyword();
  34 + $rs = $keywordModel->add($this->param);
  35 + if($rs === false){
  36 + $this->response('添加失败',Code::SYSTEM_ERROR);
36 } 37 }
  38 + $this->response('success');
37 } 39 }
38 } 40 }
@@ -30,6 +30,7 @@ class MonthCountLogic extends BaseLogic @@ -30,6 +30,7 @@ class MonthCountLogic extends BaseLogic
30 */ 30 */
31 public function getCountLists($map,$order = 'created_at',$filed = ['*']){ 31 public function getCountLists($map,$order = 'created_at',$filed = ['*']){
32 $map['project_id'] = $this->user['project_id']; 32 $map['project_id'] = $this->user['project_id'];
  33 + $new = $this->currentMonthCount();
33 $lists = $this->model->list($map,$order,$filed,'desc',10); 34 $lists = $this->model->list($map,$order,$filed,'desc',10);
34 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){ 35 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){
35 foreach ($lists as $k => $v){ 36 foreach ($lists as $k => $v){
@@ -44,10 +45,11 @@ class MonthCountLogic extends BaseLogic @@ -44,10 +45,11 @@ class MonthCountLogic extends BaseLogic
44 } 45 }
45 } 46 }
46 $v['source_country'] = json_encode(array_values($source_country)); 47 $v['source_country'] = json_encode(array_values($source_country));
  48 + $v['total'] = $new['total'] ?? $v['total'];
47 $lists[$k] = $v; 49 $lists[$k] = $v;
48 } 50 }
49 } 51 }
50 - $lists['new'] = $this->currentMonthCount(); 52 + $lists['new'] = $new;
51 return $this->success($lists); 53 return $this->success($lists);
52 } 54 }
53 55
@@ -326,6 +326,13 @@ Route::middleware(['aloginauth'])->group(function () { @@ -326,6 +326,13 @@ Route::middleware(['aloginauth'])->group(function () {
326 Route::any('/del', [\App\Http\Controllers\Aside\CustomModule\CustomModuleController::class, 'del'])->name('custom_del'); 326 Route::any('/del', [\App\Http\Controllers\Aside\CustomModule\CustomModuleController::class, 'del'])->name('custom_del');
327 }); 327 });
328 328
  329 + /**
  330 + * 生成视频的项目
  331 + */
  332 + Route::prefix('promotion_keyword')->group(function () {
  333 + Route::any('/createKeywordTask', [Aside\Com\KeywordController::class, 'createKeywordTask'])->name('promotion_keyword_createKeywordTask');
  334 + });
  335 +
329 // 公共主题模版 336 // 公共主题模版
330 Route::prefix('template')->group(function () { 337 Route::prefix('template')->group(function () {
331 Route::any('/', [Aside\Template\ATemplateController::class, 'lists'])->name('admin.ATemplate_lists'); 338 Route::any('/', [Aside\Template\ATemplateController::class, 'lists'])->name('admin.ATemplate_lists');