修改待付款订单列表

This commit is contained in:
luofei 2023-07-08 10:41:22 +08:00
parent c51850a61d
commit 4463fb9daf
5 changed files with 12 additions and 12 deletions

View File

@ -43,11 +43,12 @@ class StoreGroupOrderDao extends BaseDao
* @author xaboy
* @day 2020/6/11
*/
public function orderNumber($uid = null)
public function orderNumber($uid = null, $productType = 0)
{
return StoreGroupOrder::when($uid, function ($query, $uid) {
$query->where('uid', $uid);
})->where('is_del', 0)->where('paid', 0)->count();
$storeOrderWhere = StoreOrder::where('activity_type', $productType);
return StoreGroupOrder::hasWhere('orderList', $storeOrderWhere)->when($uid, function ($query, $uid) {
$query->where('StoreGroupOrder.uid', $uid);
})->where('StoreGroupOrder.is_del', 0)->where('StoreGroupOrder.paid', 0)->count();
}
/**

View File

@ -109,9 +109,6 @@ class StoreOrderDao extends BaseDao
case 2 :
$query->where('StoreOrder.status', $where['status'])->where('pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY);
break;
case 20 :
$query->whereRaw('paid=0 or (StoreOrder.status=' . StoreOrder::STATUS_WAIT_COMMENT . ' and pay_type=' . StoreGroupOrder::PAY_TYPE_CREDIT_BUY . ')');
break;
default:
$query->where('StoreOrder.status', $where['status']);
break;

View File

@ -195,7 +195,7 @@ class StoreOrderRepository extends BaseRepository
//修改订单状态
Db::transaction(function () use ($subOrders, $is_combine, $groupOrder) {
$time = date('Y-m-d H:i:s');
$groupOrder->paid = 1;
$groupOrder->paid = $groupOrder->pay_type == StoreGroupOrder::PAY_TYPE_CREDIT_BUY ? 0 : 1;
$groupOrder->pay_time = $time;
$groupOrder->is_combine = $is_combine;
$orderStatus = [];
@ -562,7 +562,7 @@ class StoreOrderRepository extends BaseRepository
*/
public function userOrderNumber(int $uid, $product_type=0)
{
$noPay = $this->dao->search(['uid' => $uid, 'status' => 20,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count();
$noPay = app()->make(StoreGroupOrderRepository::class)->orderNumber($uid, $product_type);
$noPostage = $this->dao->search(['uid' => $uid, 'status' => 0, 'paid' => 1,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count();
$all = $this->dao->search(['uid' => $uid, 'status' => -2,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count();
$noDeliver = $this->dao->search(['uid' => $uid, 'status' => 1, 'paid' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count();
@ -2497,6 +2497,8 @@ class StoreOrderRepository extends BaseRepository
$merchantRepo = app()->make(MerchantRepository::class);
$merchantRepo->unfreeze($groupOrder->interest->mer_id);
}
$groupOrder->paid = 1;
$groupOrder->save();
}
$groupOrder->interest->save();
Db::commit();

View File

@ -135,9 +135,7 @@ class StoreOrder extends BaseController
$where['product_type'] = $this->request->param('product_type',0);
$where['search'] = $this->request->param('store_name');
$where['uid'] = $this->request->uid();
if ($where['status'] != 20) {
$where['paid'] = 1;
}
$where['paid'] = 1;
$where['is_user'] = 1;
return app('json')->success($this->repository->getList($where, $page, $limit));
}

View File

@ -46,6 +46,8 @@ class OrderSettlePaySuccessListen implements ListenerInterface
$merchantRepo = app()->make(MerchantRepository::class);
$merchantRepo->unfreeze($groupOrder->interest->mer_id);
}
$groupOrder->paid = 1;
$groupOrder->save();
Db::commit();
} catch (\Exception $e) {
Db::rollback();