request->get(); $where = []; $where['t.userId'] = $this->userId; if (isset($get['status'])) { if($get['status'] == 3){ // 全部状态 }elseif($get['status'] == 2){ // 已失效包含:1作废 与 过期(0未使用但endTime<当前时间) --- 所以当操作作废时,status改为-1,同时将endTime改为当前时间 $where['t.endTime<'] = time(); } else { $where['t.status'] = $get['status']; } } $list = HbClass::getHbList(['t.*', 's.merchantName', 's.shopName'], $where); util::success($list); } // 单个门店下所有可用红包 public function actionAvailableHb() { $where = []; $where['customId'] = $this->customId; $where['status'] = 0; $where['endTime>'] = time(); $list = HbClass::getAllByCondition($where, 'id DESC'); util::success($list); } }