diff --git a/common/models/market/Market_sytopic_enroll_model.php b/common/models/market/Market_sytopic_enroll_model.php index aa4bc521..8f584425 100644 --- a/common/models/market/Market_sytopic_enroll_model.php +++ b/common/models/market/Market_sytopic_enroll_model.php @@ -67,8 +67,8 @@ class Market_sytopic_enroll_model extends HD_Model public function statusCn() { $statusArray = [ - self::STATUS_PENDING => '待确认', - self::STATUS_SUCCESS => '已成交', + self::STATUS_PENDING => '已到店', + self::STATUS_SUCCESS => '战败', self::STATUS_INVALID => '无效' ]; return $statusArray; diff --git a/home/controllers/h5/market/sylive2/User.php b/home/controllers/h5/market/sylive2/User.php index 565f8d97..647cf2fb 100644 --- a/home/controllers/h5/market/sylive2/User.php +++ b/home/controllers/h5/market/sylive2/User.php @@ -236,6 +236,8 @@ class User extends Admin { $page = intval($this->input->get('page')); $status = $this->input->get('status'); + $s_time = $this->input->get('s_time'); + $e_time = $this->input->get('e_time'); !$page && $page = 1; $size = 20; $user = $this->user_model->get(['userId' => $this->session['userId']]); @@ -250,6 +252,10 @@ class User extends Admin if (strlen($status)) { $where['status'] = intval($status); } + if($s_time && $e_time){ + $where['enTime>='] = date('Y-m-d', strtotime($s_time)); + $where['enTime<='] = date('Y-m-d', strtotime($e_time)); + } $total = $this->sytopic_enroll_model->count($where); $lists = []; $statusCn = $this->sytopic_enroll_model->statusCn(); diff --git a/home/views/h5/market/sylive2/user/enroll.php b/home/views/h5/market/sylive2/user/enroll.php index 3dd1cf39..a60074e5 100644 --- a/home/views/h5/market/sylive2/user/enroll.php +++ b/home/views/h5/market/sylive2/user/enroll.php @@ -1,4 +1,27 @@ +
@@ -6,6 +29,49 @@ +
+ + + + + + + + + ~ + + + + + + + + 重置 + 搜索 +
+
+ + + + +
, + tab_list: , active: 0, list: [], loading: false, finished: false, page: 1, error: false, + startTime: '', // 开始时间输入框的值 + showStartTimePicker: false, // 控制开始时间选择器显示的标志 + selectedStartTime: new Date(), // 用户选择的开始时间(在确认前) + endTime: '', // 开始时间输入框的值 + showEndTimePicker: false, // 控制开始时间选择器显示的标志 + selectedEndTime: null, // 用户选择的开始时间(在确认前) + miniEndTime: new Date(2019, 10, 1), } }, methods: { + search(){ + this.page = 1 + this.list = [] + this.onLoad() + }, onChange() { this.page = 1 this.list = [] @@ -57,10 +135,15 @@ type = that.tab_list[that.active].type } //请求接口 - $.get('/h5/market/sylive2/user/enLists', {page: that.page, status: type}, function (res) { + $.get('/h5/market/sylive2/user/enLists', { + page: that.page, + status: type, + 's_time': this.startTime, + 'e_time': this.endTime + }, function (res) { that.loading = false; if (res.code == 200) { - if(that.page===1){ + if (that.page === 1) { this.tab_list = res.data.tabList } that.page = that.page + 1 @@ -94,6 +177,24 @@ // } // }, 1000); }, + confirmStartTime(value) { + const date = new Date(+new Date(value) + 8 * 3600 * 1000) + const isoString = date.toISOString(); // ISO格式为"YYYY-MM-DDTHH:mm:ss.sssZ" + this.startTime = isoString.slice(0, 10); + this.showStartTimePicker = false; // 隐藏时间选择器 + this.miniEndTime = value + this.selectedEndTime = value + }, + confirmEndTime(value) { + const date = new Date(+new Date(value) + 8 * 3600 * 1000) + const isoString = date.toISOString(); // ISO格式为"YYYY-MM-DDTHH:mm:ss.sssZ" + this.endTime = isoString.slice(0, 10); + this.showEndTimePicker = false; // 隐藏时间选择器 + }, + reset(){ + this.startTime = '' + this.endTime = '' + } }, })