Commit 5ce543cd authored by hujun's avatar hujun

客户跟进时间搜索一个月

parent 489e4634
...@@ -41,8 +41,15 @@ class Remark extends Basic ...@@ -41,8 +41,15 @@ class Remark extends Basic
$u_phone_follow = new UPhoneFollowPp(); $u_phone_follow = new UPhoneFollowPp();
$last_month = date("Y-m-d", strtotime("-1 month"));
if (!empty($this->params['start_date']) && empty($this->params['end_date'])) { if (!empty($this->params['start_date']) && empty($this->params['end_date'])) {
$where['create_time'] = ['> time', $this->params['start_date']. ' 00:00:00']; if (strtotime($last_month) > strtotime($this->params['start_date'])) {
$where['create_time'] = ['> time', $last_month. ' 00:00:00'];
} else {
$where['create_time'] = ['> time', $this->params['start_date']. ' 00:00:00'];
}
} else {
$where['create_time'] = ['> time', $last_month. ' 00:00:00'];
} }
if (!empty($this->params['end_date']) && empty($this->params['start_date'])) { if (!empty($this->params['end_date']) && empty($this->params['start_date'])) {
...@@ -50,7 +57,12 @@ class Remark extends Basic ...@@ -50,7 +57,12 @@ class Remark extends Basic
} }
if (!empty($this->params['end_date']) && !empty($this->params['start_date'])) { if (!empty($this->params['end_date']) && !empty($this->params['start_date'])) {
$where['create_time'] = ['between',[$this->params['start_date'].' 00:00:00',$this->params['end_date']. ' 23:59:59']]; if (strtotime($last_month) > strtotime($this->params['start_date'])) {
$start_date = $last_month;
} else {
$start_date = $this->params['start_date'];
}
$where['create_time'] = ['between',[$start_date.' 00:00:00',$this->params['end_date']. ' 23:59:59']];
} }
if (!empty($this->params['content'])) { if (!empty($this->params['content'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment