作者 刘锟

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

@@ -82,7 +82,7 @@ class VideoTask extends Command @@ -82,7 +82,7 @@ class VideoTask extends Command
82 if ($sub_task_num <= 0){ 82 if ($sub_task_num <= 0){
83 break; 83 break;
84 } 84 }
85 - $task_project = KeywordVideoTask::where(['status' => KeywordVideoTask::STATUS_OPEN])->orderBy('sort', 'desc')->first(); 85 + $task_project = KeywordVideoTask::where(['status' => KeywordVideoTask::STATUS_OPEN])->orderBy('sort', 'desc')->orderBy('id', 'desc')->first();
86 if (empty($task_project)){ 86 if (empty($task_project)){
87 break; 87 break;
88 } 88 }
@@ -55,7 +55,7 @@ class UpdateRoute extends Command @@ -55,7 +55,7 @@ class UpdateRoute extends Command
55 */ 55 */
56 public function handle(){ 56 public function handle(){
57 $projectModel = new Project(); 57 $projectModel = new Project();
58 - $list = $projectModel->list(['id'=>645]); 58 + $list = $projectModel->list(['id'=>1091]);
59 $data = []; 59 $data = [];
60 foreach ($list as $v){ 60 foreach ($list as $v){
61 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; 61 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
@@ -92,13 +92,19 @@ class KeywordVideoController extends BaseController @@ -92,13 +92,19 @@ class KeywordVideoController extends BaseController
92 'project_id.required' => '项目唯一标识不为空', 92 'project_id.required' => '项目唯一标识不为空',
93 'number.required' => 'number不为空', 93 'number.required' => 'number不为空',
94 ]); 94 ]);
  95 + //查看当前项目是否已添加
  96 + $keywordModel = new KeywordVideoTask();
  97 + $keywordInfo = $keywordModel->read(['project_id'=>$this->param['project_id']]);
  98 + if($keywordInfo !== false){
  99 + $this->response('当前项目已添加');
  100 + }
95 //查看当前项目是否有正式域名 101 //查看当前项目是否有正式域名
96 $domainModel = new DomainInfo(); 102 $domainModel = new DomainInfo();
97 $info = $domainModel->read(['project_id'=>$this->param['project_id']]); 103 $info = $domainModel->read(['project_id'=>$this->param['project_id']]);
98 if($info === false){ 104 if($info === false){
99 $this->response('请先设置域名',Code::SYSTEM_ERROR); 105 $this->response('请先设置域名',Code::SYSTEM_ERROR);
100 } 106 }
101 - $keywordModel = new KeywordVideoTask(); 107 +
102 $rs = $keywordModel->add($this->param); 108 $rs = $keywordModel->add($this->param);
103 if($rs === false){ 109 if($rs === false){
104 $this->response('添加失败',Code::SYSTEM_ERROR); 110 $this->response('添加失败',Code::SYSTEM_ERROR);
@@ -9,6 +9,7 @@ use App\Http\Logic\Logic; @@ -9,6 +9,7 @@ use App\Http\Logic\Logic;
9 use App\Models\Com\UpdateNotify; 9 use App\Models\Com\UpdateNotify;
10 use App\Models\Project\Project; 10 use App\Models\Project\Project;
11 use App\Models\RouteMap\RouteDelete; 11 use App\Models\RouteMap\RouteDelete;
  12 +use App\Models\Service\Service;
12 use Illuminate\Support\Facades\Cache; 13 use Illuminate\Support\Facades\Cache;
13 use Illuminate\Support\Str; 14 use Illuminate\Support\Str;
14 15
@@ -173,7 +174,7 @@ class BaseLogic extends Logic @@ -173,7 +174,7 @@ class BaseLogic extends Logic
173 $data['project_id'] = $this->user['project_id']; 174 $data['project_id'] = $this->user['project_id'];
174 $str = http_build_query($data); 175 $str = http_build_query($data);
175 $url = $this->user['domain'].'api/delHtml/?'.$str; 176 $url = $this->user['domain'].'api/delHtml/?'.$str;
176 - if($this->user['project_id'] == 672){//TODO::当前项目通知不过 ,跳过自动更新 177 + if(isset($this->project['serve_id']) && ($this->project['serve_id'] == 3)){//TODO::当前项目通知不过 ,跳过自动更新
177 exec('curl -k "'.$url.'" > /dev/null 2>&1 &'); 178 exec('curl -k "'.$url.'" > /dev/null 2>&1 &');
178 }else{ 179 }else{
179 shell_exec('curl -k "'.$url.'"'); 180 shell_exec('curl -k "'.$url.'"');
@@ -4,6 +4,7 @@ namespace App\Http\Logic\Bside\HomeCount; @@ -4,6 +4,7 @@ namespace App\Http\Logic\Bside\HomeCount;
4 4
5 5
6 use App\Http\Logic\Bside\BaseLogic; 6 use App\Http\Logic\Bside\BaseLogic;
  7 +use App\Models\RouteMap\RouteMap;
7 use App\Models\Visit\Visit; 8 use App\Models\Visit\Visit;
8 use App\Models\Visit\VisitItem; 9 use App\Models\Visit\VisitItem;
9 use App\Models\HomeCount\Count; 10 use App\Models\HomeCount\Count;
@@ -116,7 +117,7 @@ class CountLogic extends BaseLogic @@ -116,7 +117,7 @@ class CountLogic extends BaseLogic
116 public function with_data_count(){ 117 public function with_data_count(){
117 $product_count = (new Product())->where(['project_id' => $this->user['project_id']])->count(); 118 $product_count = (new Product())->where(['project_id' => $this->user['project_id']])->count();
118 $news_count = (new News())->where(['project_id' => $this->user['project_id']])->count(); 119 $news_count = (new News())->where(['project_id' => $this->user['project_id']])->count();
119 - $page_count = (new BTemplate())->where(['project_id' => $this->user['project_id']])->count(); 120 + $page_count = (new RouteMap())->where(['project_id' => $this->user['project_id']])->count();
120 $data = [ 121 $data = [
121 'product_count' => $product_count, 122 'product_count' => $product_count,
122 'news_count' => $news_count, 123 'news_count' => $news_count,
@@ -77,7 +77,7 @@ class UserLogic extends BaseLogic @@ -77,7 +77,7 @@ class UserLogic extends BaseLogic
77 } 77 }
78 $this->param['type'] = 1; 78 $this->param['type'] = 1;
79 $this->param['operator_id'] = $this->user['id']; 79 $this->param['operator_id'] = $this->user['id'];
80 - if(isset($this->param['password']) && empty($this->param['password'])){ 80 + if(isset($this->param['password']) && !empty($this->param['password'])){
81 $this->param['password'] = base64_encode(md5($this->param['password'])); 81 $this->param['password'] = base64_encode(md5($this->param['password']));
82 } 82 }
83 $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); 83 $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);