diff --git a/admin/controllers/auto/Business.php b/admin/controllers/auto/Business.php index b72eae86..b2f08bd9 100644 --- a/admin/controllers/auto/Business.php +++ b/admin/controllers/auto/Business.php @@ -20,6 +20,9 @@ class Business extends HD_Controller{ public function index() { $params = $this->input->get(); + !isset($params['status']) && $params['status'] = 1; + !isset($params['if_effect']) && $params['if_effect'] = 1; + !isset($params['month']) && $params['month'] = ''; $where = array(); if($params['brand_id']){ @@ -60,8 +63,6 @@ class Business extends HD_Controller{ } if($params['month']){ $where['month'] = $params['month']; - }elseif(!isset($params['month'])){ - $where['month'] = $params['month'] = intval(date('m')); } $page = $params['page']; $page = !$page ? 1 : $page; diff --git a/admin/views/receiver/orderv2/lists.php b/admin/views/receiver/orderv2/lists.php index 2bfc7d8c..90e97a00 100644 --- a/admin/views/receiver/orderv2/lists.php +++ b/admin/views/receiver/orderv2/lists.php @@ -80,8 +80,8 @@
@@ -296,23 +296,28 @@ elem: '#id-bill-time', range: '~' }); $('.id-day-btn').click(function () { - var type = $(this).data('date'), date = '', d_obj = new Date(); + var type = $(this).data('date'), date = '', nowDate = new Date(); + var beginDate = '', endDate = ''; switch (type) { case 'today': - date = d_obj.Format('yyyy-MM-dd'); - date = date + ' ~ ' + date; + endDate = beginDate = nowDate.Format('yyyy-MM-dd'); break; case 'yesterday': - date = (new Date(d_obj.getTime() - 86400000)).Format('yyyy-MM-dd'); - date = date + ' ~ ' + date; + endDate = beginDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd'); break; - case '7day': - date = (new Date(d_obj.getTime() - 86400000 * 7)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd'); + case 'weeks': + nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1); + beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate(); + nowDate.setDate(nowDate.getDate() + 6); + endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate(); break; - case '30day': - date = (new Date(d_obj.getTime() - 86400000 * 30)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd'); + case 'month': + beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01"; + var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0); + endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate(); break; } + date = beginDate + ' ~ ' + endDate; $('#id-create-time').val(date); }); });