|
@@ -97,7 +97,7 @@ class Index extends Base
|
|
|
if(!in_array($type,[0,1,3])) $this->error('参数错误');
|
|
|
$in_type = $type == 0 ? '1,3' : $type;
|
|
|
$issue_mode = input('issue_mode',0);
|
|
|
- $list = Db::name('store_collection')
|
|
|
+ /* $list = Db::name('store_collection')
|
|
|
->where('is_deleted',0)
|
|
|
->where('status',1)
|
|
|
->whereIn('type',$in_type)
|
|
@@ -106,8 +106,27 @@ class Index extends Base
|
|
|
->field('id,cover,name,type,label,price,inventory,now_inventory,state,sell_time,advance_info,auth_name,auth_img,issue_mode,apply_st,before_time')
|
|
|
->order('state asc,sell_time asc')
|
|
|
->limit($this->off_set,$this->page_num)
|
|
|
+ ->select();*/
|
|
|
+
|
|
|
+ $list = Db::name('store_collection')->where(function ($query)use($in_type,$issue_mode){
|
|
|
+ if($issue_mode){
|
|
|
+ return $query->where('status',1)->where('is_deleted',0)->whereIn('type',$in_type)->where('sell_time','< time',date("Y-m-d 23:59:59"))->where('issue_mode',$issue_mode);
|
|
|
+ }else{
|
|
|
+ return $query->where('status',1)->where('is_deleted',0)->whereIn('type',$in_type)->where('sell_time','< time',date("Y-m-d 23:59:59"));
|
|
|
+ }
|
|
|
+ })->whereOr(function ($query)use($in_type,$issue_mode){
|
|
|
+ if($issue_mode){
|
|
|
+ return $query->where('status',1)->where('is_deleted',0)->whereIn('type',$in_type)->where('id',2)->where('issue_mode',$issue_mode);
|
|
|
+ }else{
|
|
|
+ return $query->where('status',1)->where('is_deleted',0)->whereIn('type',$in_type)->where('id',2);
|
|
|
+ }
|
|
|
+ })->field('id,cover,name,type,label,price,inventory,now_inventory,state,sell_time,advance_info,auth_name,auth_img,issue_mode,apply_st,before_time')
|
|
|
+ ->order('state asc,sell_time asc')
|
|
|
+ ->limit($this->off_set,$this->page_num)
|
|
|
->select();
|
|
|
|
|
|
+
|
|
|
+
|
|
|
foreach ($list as &$v){
|
|
|
$advance_minutes = $v['before_time'];
|
|
|
// 验证产品赋能优先购
|