From 2eb9e64ef3511b06a38782d3a8828db6f88e3315 Mon Sep 17 00:00:00 2001 From: liuxiaoquan Date: Tue, 14 Mar 2023 09:42:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E9=A9=BB=E7=94=B3=E8=AF=B7=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2js=E7=AD=9B=E9=80=89=E5=8A=9F=E8=83=BD=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../merchant/system/merchant/MerchantIntention.php | 7 +++++-- .../merchant/system/merchant/intention/lst.html | 3 ++- .../merchant/system/merchant/MerchantIntention.php | 14 +++++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/admin/controller/merchant/system/merchant/MerchantIntention.php b/app/admin/controller/merchant/system/merchant/MerchantIntention.php index 282cf95..ff98ef1 100644 --- a/app/admin/controller/merchant/system/merchant/MerchantIntention.php +++ b/app/admin/controller/merchant/system/merchant/MerchantIntention.php @@ -62,8 +62,8 @@ class MerchantIntention extends BaseController $params = get_params(); $page = empty($params['page'])? 1 : (int)$params['page']; $limit = empty($params['limit'])? (int)get_config('app . page_size') : (int)$params['limit']; - - $where = get_params(['mer_name', 'status', 'date', 'keyword', 'mer_intention_id', 'category_id', 'type_id']); + $where = get_params(['mer_name', 'status', 'date', 'keywords', 'mer_intention_id', 'category_id', 'type_id', 'start_date','end_date']); + $data = $this->intention->GetList($where, $page, $limit); @@ -100,6 +100,9 @@ class MerchantIntention extends BaseController return to_assign(0,'修改成功'); } + /** + * 备注表单页 + */ public function MarkForm() { $id = get_params('id'); diff --git a/app/admin/view/merchant/system/merchant/intention/lst.html b/app/admin/view/merchant/system/merchant/intention/lst.html index e950bcb..149356f 100644 --- a/app/admin/view/merchant/system/merchant/intention/lst.html +++ b/app/admin/view/merchant/system/merchant/intention/lst.html @@ -334,8 +334,9 @@ let name = data.elem.name; if (name =='today') { start_date=end_date; + end_date = getDaysAgo(-1); }else if(name == 'yeserday'){ - start_date = end_date = getDaysAgo(1); + start_date = getDaysAgo(1); }else if(name == 'week'){ start_date = getDaysAgo(7); }else if(name == '30day'){ diff --git a/app/common/model/merchant/system/merchant/MerchantIntention.php b/app/common/model/merchant/system/merchant/MerchantIntention.php index 32b682f..2660259 100644 --- a/app/common/model/merchant/system/merchant/MerchantIntention.php +++ b/app/common/model/merchant/system/merchant/MerchantIntention.php @@ -79,15 +79,20 @@ class MerchantIntention extends Model function ($query) use ($where) { $query->where('mer_type_id', $where['type_id']); }) - ->when(isset($where['keyword']) && $where['keyword'] !== '', + ->when(isset($where['keywords']) && $where['keywords'] !== '', function ($query) use ($where) { - $query->where('mer_name|phone|mark', 'like', '%' . $where['keyword'] . '%'); + $query->where('mer_name|phone|mark', 'like', '%' . $where['keywords'] . '%'); }) ->when(isset($where['date']) && $where['date'] !== '', function ($query) use ($where) { getModelTime($query, $where['date']); } ) + ->when(isset($where['start_date'])&&isset($where['end_date'])&&$where['start_date']!==''&&$where['end_date']!=='', + function($query)use($where){ + $query->where('create_time','between',[$where['start_date'], $where['end_date']]); + } + ) ->where('is_del', 0); return $query; @@ -101,9 +106,12 @@ class MerchantIntention extends Model return $rows; } + /** + * 备注表单页 + */ public function form($id, $data) { - $this->getModel()::getDB()->where($this->getPk(), $id)->update(['status' => $data['status'], 'mark' => $data['mark']]); + self::where($this->getPk(), $id)->update(['status' => $data['status'], 'mark' => $data['mark']]); } /**