Merge remote-tracking branch 'origin/master' into akun
正在显示
16 个修改的文件
包含
86 行增加
和
73 行删除
| @@ -35,7 +35,8 @@ class RemainDay extends Command | @@ -35,7 +35,8 @@ class RemainDay extends Command | ||
| 35 | * @var 暂停的项目 | 35 | * @var 暂停的项目 |
| 36 | */ | 36 | */ |
| 37 | protected $ceaseProjectId = [ | 37 | protected $ceaseProjectId = [ |
| 38 | - 354 | 38 | + 354, |
| 39 | + 1283 | ||
| 39 | ];//需要单独处理的项目 | 40 | ];//需要单独处理的项目 |
| 40 | /** | 41 | /** |
| 41 | * The console command description. | 42 | * The console command description. |
| @@ -77,14 +78,11 @@ class RemainDay extends Command | @@ -77,14 +78,11 @@ class RemainDay extends Command | ||
| 77 | continue; | 78 | continue; |
| 78 | } | 79 | } |
| 79 | $diff = time() - strtotime($opInfo['start_date'] ?? $item->uptime); | 80 | $diff = time() - strtotime($opInfo['start_date'] ?? $item->uptime); |
| 80 | - $remain_day = $item['deploy_build']['service_duration'] + $item->pause_days - floor($diff / (60 * 60 * 24)); | 81 | + $remain_day = $item['deploy_build']['service_duration'] - floor($diff / (60 * 60 * 24)); |
| 81 | }else{ | 82 | }else{ |
| 82 | if($item['type'] == Project::TYPE_TWO){ | 83 | if($item['type'] == Project::TYPE_TWO){ |
| 83 | $compliance_day = ($item->finish_remain_day ?? 0); | 84 | $compliance_day = ($item->finish_remain_day ?? 0); |
| 84 | - if($item->finish_remain_day < $item->pause_days){ | ||
| 85 | - $item->pause_days = $item->finish_remain_day; | ||
| 86 | - } | ||
| 87 | - $remain_day = $item['deploy_build']['service_duration'] + $item->pause_days - $compliance_day; | 85 | + $remain_day = $item['deploy_build']['service_duration'] - $compliance_day; |
| 88 | }else{ | 86 | }else{ |
| 89 | if($item->uptime){ | 87 | if($item->uptime){ |
| 90 | $diff = time() - strtotime($item->uptime); | 88 | $diff = time() - strtotime($item->uptime); |
| @@ -99,7 +99,7 @@ class SendProduct extends Command | @@ -99,7 +99,7 @@ class SendProduct extends Command | ||
| 99 | $start_date = date('Y-m-d H:i:s'); | 99 | $start_date = date('Y-m-d H:i:s'); |
| 100 | $end_date = date('Y-m-d 23:59:59'); | 100 | $end_date = date('Y-m-d 23:59:59'); |
| 101 | $blogModel = new Blog(); | 101 | $blogModel = new Blog(); |
| 102 | - $arr = $blogModel->formatQuery(['send_time'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url'); | 102 | + $arr = $blogModel->formatQuery(['release_at'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url'); |
| 103 | $blogModel->edit(['status'=>1],['release_at'=>['between',[$start_date,$end_date]],'status'=>3]); | 103 | $blogModel->edit(['status'=>1],['release_at'=>['between',[$start_date,$end_date]],'status'=>3]); |
| 104 | return $arr; | 104 | return $arr; |
| 105 | } | 105 | } |
| @@ -115,7 +115,7 @@ class SendProduct extends Command | @@ -115,7 +115,7 @@ class SendProduct extends Command | ||
| 115 | $start_date = date('Y-m-d H:i:s'); | 115 | $start_date = date('Y-m-d H:i:s'); |
| 116 | $end_date = date('Y-m-d 23:59:59'); | 116 | $end_date = date('Y-m-d 23:59:59'); |
| 117 | $newsModel = new News(); | 117 | $newsModel = new News(); |
| 118 | - $arr = $newsModel->formatQuery(['send_time'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url'); | 118 | + $arr = $newsModel->formatQuery(['release_at'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url'); |
| 119 | $newsModel->edit(['status'=>1],['release_at'=>['between',[$start_date,$end_date]],'status'=>3]); | 119 | $newsModel->edit(['status'=>1],['release_at'=>['between',[$start_date,$end_date]],'status'=>3]); |
| 120 | return $arr; | 120 | return $arr; |
| 121 | } | 121 | } |
| @@ -9,6 +9,7 @@ namespace App\Console\Commands\Test; | @@ -9,6 +9,7 @@ namespace App\Console\Commands\Test; | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | use App\Helper\Arr; | 11 | use App\Helper\Arr; |
| 12 | +use App\Helper\Translate; | ||
| 12 | use App\Models\Blog\Blog; | 13 | use App\Models\Blog\Blog; |
| 13 | use App\Models\Blog\BlogCategory; | 14 | use App\Models\Blog\BlogCategory; |
| 14 | use App\Models\Com\KeywordVideoTask; | 15 | use App\Models\Com\KeywordVideoTask; |
| @@ -58,65 +59,28 @@ class Demo extends Command | @@ -58,65 +59,28 @@ class Demo extends Command | ||
| 58 | */ | 59 | */ |
| 59 | protected $description = 'demo'; | 60 | protected $description = 'demo'; |
| 60 | 61 | ||
| 61 | - public static $main404Html = '<main> | ||
| 62 | - <section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404" | ||
| 63 | - id="sectionIdyxqu938"> | ||
| 64 | - <div class="layout" data-unable="demo01-error404"> | ||
| 65 | - <img src="https://ecdn6.globalso.com/upload/m/image_other/2023-10/6528a87e594db30162.png" /> | ||
| 66 | - </div> | ||
| 67 | - <p style="text-align: center">SORRY. THE PAGE HAS EITHER MOVED OR CANNOT BE FOUND.</p> | ||
| 68 | - <style> | ||
| 69 | - .section-block-error404 .layout { | ||
| 70 | - height: 700px; | ||
| 71 | - display: flex; | ||
| 72 | - align-items: center; | ||
| 73 | - justify-content: center; | ||
| 74 | - } | ||
| 75 | - .section-block-error404 img { | ||
| 76 | - width: 400px; | ||
| 77 | - } | ||
| 78 | - @media only screen and (max-width:500) { | ||
| 79 | - .section-block-error404 img { | ||
| 80 | - max-width: 100%; | ||
| 81 | - } | ||
| 82 | - } | ||
| 83 | - </style> | ||
| 84 | - <script> | ||
| 85 | - </script> | ||
| 86 | - </section> | ||
| 87 | - </main>'; | ||
| 88 | public function handle(){ | 62 | public function handle(){ |
| 89 | $projectModel = new Project(); | 63 | $projectModel = new Project(); |
| 90 | - $list = $projectModel->list(['is_upgrade'=>1]); | ||
| 91 | - $data = []; | 64 | + $list = $projectModel->list(['id'=>1659]); |
| 92 | foreach ($list as $v){ | 65 | foreach ($list as $v){ |
| 93 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 66 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| 94 | ProjectServer::useProject($v['id']); | 67 | ProjectServer::useProject($v['id']); |
| 95 | - $this->init404Page($v['id']); | 68 | + $this->getProduct(); |
| 96 | DB::disconnect('custom_mysql'); | 69 | DB::disconnect('custom_mysql'); |
| 97 | } | 70 | } |
| 98 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 71 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| 99 | } | 72 | } |
| 100 | - public static function init404Page($project_id){ | ||
| 101 | - $time = date('Y-m-d H:i:s'); | ||
| 102 | - $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->where('url',BCustomTemplate::NOT_FOUND_PAGE_URL)->first(); | ||
| 103 | - if(empty($info)) { | ||
| 104 | - $data = [ | ||
| 105 | - 'project_id' => $project_id, | ||
| 106 | - 'name' => BCustomTemplate::NOT_FOUND_PAGE_URL, | ||
| 107 | - 'status' => 1, | ||
| 108 | - 'url' => BCustomTemplate::NOT_FOUND_PAGE_URL, | ||
| 109 | - 'html' => self::$main404Html, | ||
| 110 | - 'html_style' => '<style id="globalsojs-styles"></style>', | ||
| 111 | - 'title' => '404-Page not found', | ||
| 112 | - 'description' => 'Sorry. The page has either moved or cannot be found.', | ||
| 113 | - 'created_at' => $time, 'updated_at' => $time]; | ||
| 114 | - $id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data); | ||
| 115 | - //路由 | ||
| 116 | - $info = DB::connection('custom_mysql')->table('gl_route_map')->first(); | ||
| 117 | - if(empty($info)) { | ||
| 118 | - $data = ['project_id' => $project_id, 'source' => RouteMap::SOURCE_PAGE, 'source_id' => $id, 'route' => BCustomTemplate::NOT_FOUND_PAGE_URL, 'created_at' => $time, 'updated_at' => $time]; | ||
| 119 | - DB::connection('custom_mysql')->table('gl_route_map')->insert($data); | 73 | + |
| 74 | + public function getProduct(){ | ||
| 75 | + $productModel = new Product(); | ||
| 76 | + $lists = $productModel->list(['status'=>['!=',2]]); | ||
| 77 | + if(!empty($lists)){ | ||
| 78 | + foreach ($lists as $v){ | ||
| 79 | + if(!empty($v['route'])){ | ||
| 80 | + echo date('Y-m-d H:i:s') . 'id :'.$v['id'] . PHP_EOL; | ||
| 81 | + $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT, $v['id'], $v['project_id']); | ||
| 82 | + $productModel->edit(['route'=>$route],['id'=>$v['id']]); | ||
| 83 | + } | ||
| 120 | } | 84 | } |
| 121 | } | 85 | } |
| 122 | } | 86 | } |
| @@ -296,9 +296,10 @@ class WebTraffic extends Command | @@ -296,9 +296,10 @@ class WebTraffic extends Command | ||
| 296 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') | 296 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') |
| 297 | ->where('pdo.domain', '>', 0) | 297 | ->where('pdo.domain', '>', 0) |
| 298 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) | 298 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) |
| 299 | - ->whereIn('gl_project.type', [Project::TYPE_TWO, Project::TYPE_FOUR]) | 299 | + ->where('gl_project.type', Project::TYPE_TWO) |
| 300 | ->where('gl_project.is_upgrade', 0) //非升级项目 | 300 | ->where('gl_project.is_upgrade', 0) //非升级项目 |
| 301 | ->where('gl_project.main_lang_id', '<>', $ru_lang_id) //非俄语站 | 301 | ->where('gl_project.main_lang_id', '<>', $ru_lang_id) //非俄语站 |
| 302 | + ->WhereRaw("NOT FIND_IN_SET(2, `level`)") //非暂停优化 | ||
| 302 | ->where(function ($query) use ($type) { | 303 | ->where(function ($query) use ($type) { |
| 303 | if($type == 1){ | 304 | if($type == 1){ |
| 304 | //1-3个月项目 | 305 | //1-3个月项目 |
| @@ -329,9 +329,10 @@ class WebTrafficRussia extends Command | @@ -329,9 +329,10 @@ class WebTrafficRussia extends Command | ||
| 329 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') | 329 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') |
| 330 | ->where('pdo.domain', '>', 0) | 330 | ->where('pdo.domain', '>', 0) |
| 331 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) | 331 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) |
| 332 | - ->whereIn('gl_project.type', [Project::TYPE_TWO, Project::TYPE_FOUR]) | 332 | + ->where('gl_project.type', Project::TYPE_TWO) |
| 333 | ->where('gl_project.is_upgrade', 0) //非升级项目 | 333 | ->where('gl_project.is_upgrade', 0) //非升级项目 |
| 334 | ->where('gl_project.main_lang_id', $ru_lang_id)// 俄语站 | 334 | ->where('gl_project.main_lang_id', $ru_lang_id)// 俄语站 |
| 335 | + ->WhereRaw("NOT FIND_IN_SET(2, `level`)") //非暂停优化 | ||
| 335 | ->where(function ($query) use ($type) { | 336 | ->where(function ($query) use ($type) { |
| 336 | if($type == 1){ | 337 | if($type == 1){ |
| 337 | //1-3个月项目 | 338 | //1-3个月项目 |
| @@ -325,10 +325,11 @@ class WebTrafficRussiaSpecial extends Command | @@ -325,10 +325,11 @@ class WebTrafficRussiaSpecial extends Command | ||
| 325 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') | 325 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') |
| 326 | ->where('pdo.domain', '>', 0) | 326 | ->where('pdo.domain', '>', 0) |
| 327 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) | 327 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) |
| 328 | - ->whereIn('gl_project.type', [Project::TYPE_TWO, Project::TYPE_FOUR]) | 328 | + ->where('gl_project.type', Project::TYPE_TWO) |
| 329 | ->where('gl_project.is_upgrade', 0) //非升级项目 | 329 | ->where('gl_project.is_upgrade', 0) //非升级项目 |
| 330 | ->where('gl_project.main_lang_id', $ru_lang_id)// 俄语站 | 330 | ->where('gl_project.main_lang_id', $ru_lang_id)// 俄语站 |
| 331 | ->whereIn('gl_project.id', array_keys($projects)) | 331 | ->whereIn('gl_project.id', array_keys($projects)) |
| 332 | + ->WhereRaw("NOT FIND_IN_SET(2, `level`)") //非暂停优化 | ||
| 332 | ->select(['pdo.project_id','gl_project.main_lang_id','gl_project.id'])->forPage($page, 500)->orderBy('project_id')->get(); | 333 | ->select(['pdo.project_id','gl_project.main_lang_id','gl_project.id'])->forPage($page, 500)->orderBy('project_id')->get(); |
| 333 | //其他地方在引流的域名 | 334 | //其他地方在引流的域名 |
| 334 | // $other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray(); | 335 | // $other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray(); |
| @@ -291,10 +291,11 @@ class WebTrafficSpecial extends Command | @@ -291,10 +291,11 @@ class WebTrafficSpecial extends Command | ||
| 291 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') | 291 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') |
| 292 | ->where('pdo.domain', '>', 0) | 292 | ->where('pdo.domain', '>', 0) |
| 293 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) | 293 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) |
| 294 | - ->whereIn('gl_project.type', [Project::TYPE_TWO, Project::TYPE_FOUR]) | 294 | + ->where('gl_project.type', Project::TYPE_TWO) |
| 295 | ->where('gl_project.is_upgrade', 0) //非升级项目 | 295 | ->where('gl_project.is_upgrade', 0) //非升级项目 |
| 296 | ->where('gl_project.main_lang_id', '<>', $ru_lang_id) //非俄语站 | 296 | ->where('gl_project.main_lang_id', '<>', $ru_lang_id) //非俄语站 |
| 297 | ->whereIn('gl_project.id', array_keys($projects)) | 297 | ->whereIn('gl_project.id', array_keys($projects)) |
| 298 | + ->WhereRaw("NOT FIND_IN_SET(2, `level`)") //非暂停优化 | ||
| 298 | ->select(['pdo.project_id','gl_project.main_lang_id','gl_project.id'])->forPage($page, 500)->orderBy('project_id')->get(); | 299 | ->select(['pdo.project_id','gl_project.main_lang_id','gl_project.id'])->forPage($page, 500)->orderBy('project_id')->get(); |
| 299 | //其他地方在引流的域名 | 300 | //其他地方在引流的域名 |
| 300 | // $other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray(); | 301 | // $other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray(); |
| @@ -35,7 +35,12 @@ class OaGlobalsoApi | @@ -35,7 +35,12 @@ class OaGlobalsoApi | ||
| 35 | public function order_info($order_id) | 35 | public function order_info($order_id) |
| 36 | { | 36 | { |
| 37 | $api_url = $this->url . '/api/order_info?token='.$this->token.'&order_id='.$order_id; | 37 | $api_url = $this->url . '/api/order_info?token='.$this->token.'&order_id='.$order_id; |
| 38 | - $res = http_get($api_url,["charset" => "UTF-8"]); | 38 | +// $res = http_get($api_url,["charset" => "UTF-8"]); |
| 39 | + $client = new \GuzzleHttp\Client(); | ||
| 40 | + $data = $client->request('GET', $api_url, [ | ||
| 41 | + 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号 | ||
| 42 | + ])->getBody()->getContents(); | ||
| 43 | + $res = json_decode($data, true); | ||
| 39 | return $res; | 44 | return $res; |
| 40 | } | 45 | } |
| 41 | 46 | ||
| @@ -53,7 +58,11 @@ class OaGlobalsoApi | @@ -53,7 +58,11 @@ class OaGlobalsoApi | ||
| 53 | ]; | 58 | ]; |
| 54 | 59 | ||
| 55 | try { | 60 | try { |
| 56 | - $res = HttpUtils::get($api_url, $params); | 61 | +// $res = HttpUtils::get($api_url, $params); |
| 62 | + $client = new \GuzzleHttp\Client(); | ||
| 63 | + $res = $client->request('GET', $api_url .'?'. http_build_query($params), [ | ||
| 64 | + 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号 | ||
| 65 | + ])->getBody()->getContents(); | ||
| 57 | $res = Arr::s2a($res); | 66 | $res = Arr::s2a($res); |
| 58 | } catch (\Exception | GuzzleException $e) { | 67 | } catch (\Exception | GuzzleException $e) { |
| 59 | errorLog('渠道信息', $params, $e); | 68 | errorLog('渠道信息', $params, $e); |
| @@ -73,7 +73,11 @@ class BlogController extends BaseController | @@ -73,7 +73,11 @@ class BlogController extends BaseController | ||
| 73 | $query = $query->where('operator_id',$this->map['operator_id']); | 73 | $query = $query->where('operator_id',$this->map['operator_id']); |
| 74 | } | 74 | } |
| 75 | if(isset($this->map['status'])){ | 75 | if(isset($this->map['status'])){ |
| 76 | - $query = $query->where('status',$this->map['status']); | 76 | + if($this->map['status'] == 0){ |
| 77 | + $query = $query->whereIn('status',[0,3]); | ||
| 78 | + }else{ | ||
| 79 | + $query = $query->where('status',$this->map['status']); | ||
| 80 | + } | ||
| 77 | } | 81 | } |
| 78 | if(isset($this->map['name']) && !empty($this->map['name'])){ | 82 | if(isset($this->map['name']) && !empty($this->map['name'])){ |
| 79 | $query = $query->where('name',$this->map['name'][0],'%'.$this->map['name'][1].'%'); | 83 | $query = $query->where('name',$this->map['name'][0],'%'.$this->map['name'][1].'%'); |
| @@ -77,7 +77,11 @@ class NewsController extends BaseController | @@ -77,7 +77,11 @@ class NewsController extends BaseController | ||
| 77 | $query = $query->where('operator_id',$this->map['operator_id']); | 77 | $query = $query->where('operator_id',$this->map['operator_id']); |
| 78 | } | 78 | } |
| 79 | if(isset($this->map['status'])){ | 79 | if(isset($this->map['status'])){ |
| 80 | - $query = $query->where('status',$this->map['status']); | 80 | + if($this->map['status'] == 0){ |
| 81 | + $query = $query->whereIn('status',[0,3]); | ||
| 82 | + }else{ | ||
| 83 | + $query = $query->where('status',$this->map['status']); | ||
| 84 | + } | ||
| 81 | } | 85 | } |
| 82 | if(isset($this->map['name']) && !empty($this->map['name'])){ | 86 | if(isset($this->map['name']) && !empty($this->map['name'])){ |
| 83 | $query = $query->where('name',$this->map['name'][0],'%'.$this->map['name'][1].'%'); | 87 | $query = $query->where('name',$this->map['name'][0],'%'.$this->map['name'][1].'%'); |
| @@ -47,7 +47,7 @@ class ProductController extends BaseController | @@ -47,7 +47,7 @@ class ProductController extends BaseController | ||
| 47 | */ | 47 | */ |
| 48 | public function index(Product $product) | 48 | public function index(Product $product) |
| 49 | { | 49 | { |
| 50 | - $filed = ['id', 'project_id', 'title', 'sort' ,'thumb' ,'product_type' , 'route' , | 50 | + $filed = ['id', 'project_id', 'title', 'sort' ,'thumb' ,'product_type' , 'route' , 'intro' , 'content' , |
| 51 | 'category_id', 'keyword_id', 'status', 'created_uid', 'is_upgrade' ,'created_at', 'updated_at','six_read']; | 51 | 'category_id', 'keyword_id', 'status', 'created_uid', 'is_upgrade' ,'created_at', 'updated_at','six_read']; |
| 52 | $this->order = 'sort'; | 52 | $this->order = 'sort'; |
| 53 | $query = $product->orderBy($this->order ,'desc')->orderBy('id','desc'); | 53 | $query = $product->orderBy($this->order ,'desc')->orderBy('id','desc'); |
| @@ -219,7 +219,11 @@ class BlogLogic extends BaseLogic | @@ -219,7 +219,11 @@ class BlogLogic extends BaseLogic | ||
| 219 | if($v == 3){ | 219 | if($v == 3){ |
| 220 | $data[$k] = $this->model->where(['project_id'=>$this->user['project_id']])->count(); | 220 | $data[$k] = $this->model->where(['project_id'=>$this->user['project_id']])->count(); |
| 221 | }else{ | 221 | }else{ |
| 222 | - $data[$k] = $this->model->where(['status'=>$v,'project_id'=>$this->user['project_id']])->count(); | 222 | + if($v == 0){ |
| 223 | + $data[$k] = $this->model->formatQuery(['status' => ['in',[0,3]], 'project_id' => $this->user['project_id']])->count(); | ||
| 224 | + }else{ | ||
| 225 | + $data[$k] = $this->model->where(['status' => $v, 'project_id' => $this->user['project_id']])->count(); | ||
| 226 | + } | ||
| 223 | } | 227 | } |
| 224 | } | 228 | } |
| 225 | return $this->success($data); | 229 | return $this->success($data); |
| @@ -236,7 +236,11 @@ class NewsLogic extends BaseLogic | @@ -236,7 +236,11 @@ class NewsLogic extends BaseLogic | ||
| 236 | if ($v == 3) { | 236 | if ($v == 3) { |
| 237 | $data[$k] = $this->model->where(['project_id' => $this->user['project_id']])->count(); | 237 | $data[$k] = $this->model->where(['project_id' => $this->user['project_id']])->count(); |
| 238 | } else { | 238 | } else { |
| 239 | - $data[$k] = $this->model->where(['status' => $v, 'project_id' => $this->user['project_id']])->count(); | 239 | + if($v == 0){ |
| 240 | + $data[$k] = $this->model->formatQuery(['status' => ['in',[0,3]], 'project_id' => $this->user['project_id']])->count(); | ||
| 241 | + }else{ | ||
| 242 | + $data[$k] = $this->model->where(['status' => $v, 'project_id' => $this->user['project_id']])->count(); | ||
| 243 | + } | ||
| 240 | } | 244 | } |
| 241 | } | 245 | } |
| 242 | return $this->success($data); | 246 | return $this->success($data); |
| @@ -447,7 +447,10 @@ class RankDataLogic extends BaseLogic | @@ -447,7 +447,10 @@ class RankDataLogic extends BaseLogic | ||
| 447 | $without_project_ids = []; //不用处理排名的项目 | 447 | $without_project_ids = []; //不用处理排名的项目 |
| 448 | $without_extension_project_ids = [658]; //是否达标只统计主词的 | 448 | $without_extension_project_ids = [658]; //是否达标只统计主词的 |
| 449 | $extension_project_ids = [354]; //扩展词也到达标的 | 449 | $extension_project_ids = [354]; //扩展词也到达标的 |
| 450 | - | 450 | + $ceaseProjectId = [ |
| 451 | + 354, | ||
| 452 | + 1283 | ||
| 453 | + ];//暂停项目id | ||
| 451 | $first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0; | 454 | $first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0; |
| 452 | $first_page_without_extension_num = 0; //不算扩展词在首页的数量 | 455 | $first_page_without_extension_num = 0; //不算扩展词在首页的数量 |
| 453 | $first_page_extension_num = 0; //扩展词在首页的数量 | 456 | $first_page_extension_num = 0; //扩展词在首页的数量 |
| @@ -516,8 +519,13 @@ class RankDataLogic extends BaseLogic | @@ -516,8 +519,13 @@ class RankDataLogic extends BaseLogic | ||
| 516 | //项目表更新 | 519 | //项目表更新 |
| 517 | if (($model->updated_date != date('Y-m-d') || empty($model_is_compliance)) && !$lang) { | 520 | if (($model->updated_date != date('Y-m-d') || empty($model_is_compliance)) && !$lang) { |
| 518 | $compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0; | 521 | $compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0; |
| 519 | - Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day + 1]); | ||
| 520 | - Log::channel('rank_data')->info('项目' . $project_id . '达标天数+1:'. ($compliance_day + 1)); | 522 | + if(!in_array($project_id,$ceaseProjectId)){ |
| 523 | + Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day + 1]); | ||
| 524 | + Log::channel('rank_data')->info('项目' . $project_id . '达标天数+1:'. ($compliance_day + 1)); | ||
| 525 | + }else{ | ||
| 526 | + Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day]); | ||
| 527 | + Log::channel('rank_data')->info('项目' . $project_id . '暂停项目达标天数不加:'. ($compliance_day)); | ||
| 528 | + } | ||
| 521 | } | 529 | } |
| 522 | $model->is_compliance = 1; | 530 | $model->is_compliance = 1; |
| 523 | } else { | 531 | } else { |
| @@ -84,13 +84,14 @@ class Product extends Base | @@ -84,13 +84,14 @@ class Product extends Base | ||
| 84 | const STATUS_DRAFT = 0; | 84 | const STATUS_DRAFT = 0; |
| 85 | const STATUS_ON = 1; | 85 | const STATUS_ON = 1; |
| 86 | const STATUS_RECYCLE = 2; | 86 | const STATUS_RECYCLE = 2; |
| 87 | - | 87 | + const STATUS_THREE = 3; |
| 88 | 88 | ||
| 89 | public static function statusMap(){ | 89 | public static function statusMap(){ |
| 90 | return [ | 90 | return [ |
| 91 | self::STATUS_DRAFT => '草稿', | 91 | self::STATUS_DRAFT => '草稿', |
| 92 | self::STATUS_ON => '已发布', | 92 | self::STATUS_ON => '已发布', |
| 93 | self::STATUS_RECYCLE => '回收站', | 93 | self::STATUS_RECYCLE => '回收站', |
| 94 | + self::STATUS_THREE => '待发布', | ||
| 94 | ]; | 95 | ]; |
| 95 | } | 96 | } |
| 96 | 97 |
| @@ -126,6 +126,19 @@ class SyncSubmitTaskService | @@ -126,6 +126,19 @@ class SyncSubmitTaskService | ||
| 126 | //数组key转为小写 | 126 | //数组key转为小写 |
| 127 | $data['data'] = array_change_key_case($data['data'], CASE_LOWER); | 127 | $data['data'] = array_change_key_case($data['data'], CASE_LOWER); |
| 128 | 128 | ||
| 129 | + //特殊处理1986的表单 | ||
| 130 | + if($data['project_id'] == 1986){ | ||
| 131 | + $fields = ['乘用车', '商用车', '能源存储', '探索新业务']; | ||
| 132 | + $form_fields = array_keys($data['data']); | ||
| 133 | + if(array_intersect($form_fields, $fields)){ | ||
| 134 | + foreach ($fields as $field){ | ||
| 135 | + if (!isset($data['data'][$field])){ | ||
| 136 | + $data['data'][$field] = []; | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + } | ||
| 140 | + } | ||
| 141 | + | ||
| 129 | $form_id = InquiryForm::getFromId($data['data']); | 142 | $form_id = InquiryForm::getFromId($data['data']); |
| 130 | 143 | ||
| 131 | $data['referer'] = $this->handle_referer($data['referer']); | 144 | $data['referer'] = $this->handle_referer($data['referer']); |
-
请 注册 或 登录 后发表评论