合并分支 'master-server' 到 'master'
定时发布功能 查看合并请求 !741
正在显示
4 个修改的文件
包含
14 行增加
和
5 行删除
| @@ -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 | } |
| @@ -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 |
-
请 注册 或 登录 后发表评论