待使用订单搜索
This commit is contained in:
parent
d1be037575
commit
5f5fa2f82e
|
@ -98,6 +98,19 @@
|
|||
<el-option key="1" label="已预约(未处理)" value="1" />
|
||||
<el-option key="2" label="已预约(已处理)" value="2" />
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="listQuery.un_use_type"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="待使用"
|
||||
class="filter-item"
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option key="1" label="30天待使用" value="1" />
|
||||
<el-option key="2" label="60天待使用" value="2" />
|
||||
<el-option key="3" label="60天待使用" value="3" />
|
||||
</el-select>
|
||||
|
||||
|
||||
<el-button
|
||||
class="filter-item"
|
||||
|
@ -752,6 +765,7 @@ export default {
|
|||
zhubo: null,
|
||||
os_status: [],
|
||||
appointment_status: "",
|
||||
un_use_type: "",
|
||||
},
|
||||
item: { next_follow: "", personnel: {} },
|
||||
confirmItem: { next_follow: "", personnel: { adult: "" }, dyOrderAppointments:{book_info:{}, number_of_guests:{}} },
|
||||
|
|
|
@ -64,6 +64,12 @@ class LoginController extends base
|
|||
}
|
||||
|
||||
public function Logout(Request $request) {
|
||||
// 判断在线时长,低于8小时不可下线
|
||||
$admin = Admins::where('id', $request->admin->id)->find();
|
||||
$workTime = time() - $admin->start_work_time;
|
||||
if ($admin->is_order == 1 && $workTime < 60*60*8) {
|
||||
return $this->error(1004,'未满8小时暂不能下线,请联系管理员');
|
||||
}
|
||||
$md5 = md5($request->token);
|
||||
Redis::set('Admin:logout:'.$md5, time() , 'EX', 3600*24);
|
||||
setcookie('Admin-Token', '', time() - 3600);
|
||||
|
|
|
@ -77,6 +77,25 @@ class OrderController extends base
|
|||
}
|
||||
}
|
||||
}
|
||||
if ($unUseType = $request->get('un_use_type', 0)) {
|
||||
$query->whereRaw(Orders::AllOssStatusSql[1]);
|
||||
switch ($unUseType) {
|
||||
case 1:
|
||||
list($start, $end) = calculateDateRange(30, 60);
|
||||
break;
|
||||
case 2:
|
||||
list($start, $end) = calculateDateRange(60, 80);
|
||||
break;
|
||||
case 3:
|
||||
list($start, $end) = calculateDateRange(80, 365);
|
||||
break;
|
||||
default:
|
||||
list($start, $end) = calculateDateRange(30, 365);
|
||||
break;
|
||||
}
|
||||
$query->whereBetweenTime('give_time', $start, $end);
|
||||
$query->whereRaw(Orders::AllOssStatusSql[1]);
|
||||
}
|
||||
|
||||
if($status!=null && $status >= 0) {
|
||||
$query->where('status', $status);
|
||||
|
|
|
@ -68,3 +68,22 @@ function getNewOrderId($type) {
|
|||
$orderId = $type . $msectime . mt_rand(10000, max(intval($msec * 10000) + 10000, 98369));
|
||||
return $orderId;
|
||||
}
|
||||
|
||||
function calculateDateRange($startDays, $endDays) {
|
||||
// 获取当前日期
|
||||
$currentDate = new DateTime();
|
||||
|
||||
// 计算开始日期 (当前时间减去开始天数)
|
||||
$startDate = clone $currentDate;
|
||||
$startDate->modify("-$startDays days");
|
||||
|
||||
// 计算结束日期 (当前时间减去结束天数)
|
||||
$endDate = clone $currentDate;
|
||||
$endDate->modify("-$endDays days");
|
||||
|
||||
// 返回格式化后的日期
|
||||
return [
|
||||
$startDate->format('Y-m-d'), // 开始日期
|
||||
$endDate->format('Y-m-d H:i:s') // 结束日期
|
||||
];
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ class Orders extends base
|
|||
// 0 1 2 3 4 5 6 7 8
|
||||
|
||||
const AllOssStatusSql = [
|
||||
1 => '((os in (1,7) and order_status=3) or (os=2 and order_status=4) or (os in ("3", "5") and order_status=1))', //待使用
|
||||
1 => '( (os in (1,7) and order_status=3) or (os=2 and order_status=4) or (os in ("3", "5") and order_status=1) or (os in ("8") and order_status=200) )', //待使用
|
||||
2 => '((os in (1,7) and order_status=4) or (os=2 and order_status=5) or (os in ("3", "5") and order_status=2))', //已核销
|
||||
3 => '((os in (1,7) and order_status=5) or (os in ("3", "5") and order_status=4))' //已退款(快手暂无已退款状态)
|
||||
];
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-23c8e4b2]{position:relative;padding-bottom:60px}.el-table[data-v-23c8e4b2],.filter-container[data-v-23c8e4b2]{padding-bottom:5px}
|
||||
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-37ee8c4e]{position:relative;padding-bottom:60px}.el-table[data-v-37ee8c4e],.filter-container[data-v-37ee8c4e]{padding-bottom:5px}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue