|
|
@@ -37,15 +37,13 @@ class OrderClearController extends BaseController
|
|
|
$custom = CustomClass::getById($customId, true);
|
|
|
CustomClass::valid($custom, $this->shopId);
|
|
|
|
|
|
- $current = time();
|
|
|
-
|
|
|
$where = ['customId' => $customId, 'status' => PurchaseClearClass::STATUS_AWAIT_PAY];
|
|
|
|
|
|
$searchTime = $post['searchTime'] ?? '';
|
|
|
//结账记录太多数据库会报错,所以必须选月份才能结账!!!!!
|
|
|
//订单详情里可以单个结账
|
|
|
- if (count((array)$id) > 120) {
|
|
|
- util::fail('提交订单数超过120单');
|
|
|
+ if (count((array)$id) > 135) {
|
|
|
+ util::fail('提交订单数超过135单');
|
|
|
}
|
|
|
$startTime = $post['startTime'] ?? '';
|
|
|
$endTime = $post['endTime'] ?? '';
|
|
|
@@ -56,18 +54,12 @@ class OrderClearController extends BaseController
|
|
|
util::fail('超过30天,请按月结账');
|
|
|
}
|
|
|
|
|
|
- //查找有没结帐订单还没有过期
|
|
|
$list = OrderClearClass::getAllByCondition($where, null, '*', null, true);
|
|
|
if (!empty($list)) {
|
|
|
foreach ($list as $item) {
|
|
|
- $deadline = $item->deadline;
|
|
|
- $deadTime = strtotime($deadline);
|
|
|
- if ($current > $deadTime) {
|
|
|
- $item->status = PurchaseClearClass::STATUS_EXPIRE;
|
|
|
- $item->save();
|
|
|
- } else {
|
|
|
- util::success(['hasUnComplete' => 1], '此客户还有待完成结账单');
|
|
|
- }
|
|
|
+ //只要新建账单,老账单就取消掉
|
|
|
+ $item->status = PurchaseClearClass::STATUS_EXPIRE;
|
|
|
+ $item->save();
|
|
|
}
|
|
|
}
|
|
|
|