作者 赵彬吉
@@ -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 }
@@ -956,10 +956,10 @@ class ProjectUpdate extends Command @@ -956,10 +956,10 @@ class ProjectUpdate extends Command
956 foreach ($items as $item) { 956 foreach ($items as $item) {
957 $route = $this->get_url_route($item['url'] ?? ''); 957 $route = $this->get_url_route($item['url'] ?? '');
958 if ($route) { 958 if ($route) {
959 - $cate = $model->read(['route' => $route], 'id');  
960 - if (!$cate) {  
961 - try {  
962 - $item['name'] = $this->special2str($item['name'] ?? ''); 959 + $item['name'] = $this->special2str($item['name'] ?? '');
  960 + try {
  961 + $cate = $model->read(['route' => $route], 'id');
  962 + if (!$cate) {
963 $cate_id = $model->addReturnId([ 963 $cate_id = $model->addReturnId([
964 'project_id' => $project_id, 964 'project_id' => $project_id,
965 'module_id' => $module_id, 965 'module_id' => $module_id,
@@ -968,10 +968,15 @@ class ProjectUpdate extends Command @@ -968,10 +968,15 @@ class ProjectUpdate extends Command
968 'route' => $route 968 'route' => $route
969 ]); 969 ]);
970 $this->set_map($route, RouteMap::SOURCE_MODULE_CATE, $cate_id, $project_id); 970 $this->set_map($route, RouteMap::SOURCE_MODULE_CATE, $cate_id, $project_id);
971 - } catch (\Exception $e) {  
972 - echo 'date:' . date('Y-m-d H:i:s') . ', category_custom_insert error: ' . $e->getMessage() . PHP_EOL;  
973 - continue; 971 + } else {
  972 + $model->edit([
  973 + 'name' => $item['name'],
  974 + 'original_id' => $item['id'],
  975 + ], ['id' => $cate['id']]);
974 } 976 }
  977 + } catch (\Exception $e) {
  978 + echo 'date:' . date('Y-m-d H:i:s') . ', category_custom_insert error: ' . $e->getMessage() . PHP_EOL;
  979 + continue;
975 } 980 }
976 } 981 }
977 } 982 }
@@ -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].'%');
@@ -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