goodsModel = new GoodsModel($this->site_id); $this->Choice = new Choice($this->site_id); } public function lists() { if (request()->isAjax()) { // 参数获取 $start_time = input('start_time', ''); $end_time = input('end_time', ''); $search = input('goods_name', ''); if ($start_time && $end_time) { $condition[] = ['w.create_time', 'between', [date_to_time($start_time), date_to_time($end_time)]]; } elseif (!$start_time && $end_time) { $condition[] = ['w.create_time', '<=', date_to_time($end_time)]; } elseif ($start_time && !$end_time) { $condition[] = ['w.create_time', '>=', date_to_time($start_time)]; } //筛选商品名称 if (!empty($search)) { $condition[] = ['w.goods_name', 'like', '%' . $search . '%']; } $status = input('goods_state', ''); if (!empty($status)) { $condition[] = ['w.goods_state', '=', $status]; } $condition[] = ['w.site_id', '=', $this->site_id]; $page = input('page', 1); $page_size = input('page_size', PAGE_LIST_ROWS); return $this->goodsModel->getGoodsList($condition, $page, $page_size); } $this->forthMenu(); return $this->fetch("follow/lists"); } }