From 3be0a42dc4279acd87cc14c03d4c0b0891f69f0b Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Mon, 18 Mar 2024 09:21:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B8=8B=E5=8D=95=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/store/order/StoreCartDao.php | 2 +- .../repositories/store/order/StoreOrderCreateRepository.php | 1 + app/controller/api/store/merchant/Merchant.php | 1 + app/event.php | 2 +- crmeb/listens/AutoSendPayOrderSmsListen.php | 1 + crmeb/listens/AutoUnlockMerchantMoneyListen.php | 4 ++-- 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/common/dao/store/order/StoreCartDao.php b/app/common/dao/store/order/StoreCartDao.php index ce62d97e..8004b0a3 100644 --- a/app/common/dao/store/order/StoreCartDao.php +++ b/app/common/dao/store/order/StoreCartDao.php @@ -106,7 +106,7 @@ class StoreCartDao extends BaseDao ->append(['bc_extension_one', 'bc_extension_two']); }, 'merchant' => function (Relation $query) use ($uid) { - $query->field('mer_id,mer_name,mer_state,mer_avatar,delivery_way,commission_rate,category_id,wholesale') + $query->field('mer_id,mer_name,mer_state,mer_avatar,delivery_way,commission_rate,category_id,wholesale,type_id') ->with([ 'coupon' => function ($query) use ($uid) { $query->where('uid', $uid); diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index fd1d988a..779d9768 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -1454,6 +1454,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository */ protected function validateCartList($cartId,$address,$user) { + /** @var storeCartRepository $storeCartRepository */ $storeCartRepository = app()->make(storeCartRepository::class); $cartData = $storeCartRepository->cartIbByData($cartId, $user->uid, $address); $res = $storeCartRepository->checkCartList($cartData, 0, $user); diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index 0d0e9c16..09098587 100644 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -375,6 +375,7 @@ class Merchant extends BaseController if (empty($merchantInfo)) { return app('json')->fail('参数错误'); } + $merchantInfo['paid_margin'] = $merchantInfo['paid_margin'] > $merchantInfo['margin'] ? $merchantInfo['margin'] : $merchantInfo['paid_margin']; $merchantInfo['unpaid_margin'] = bcsub($merchantInfo['margin'], $merchantInfo['paid_margin'], 2); if ($merchantInfo['margin'] <= 0) { $merchantInfo['unpaid_margin'] = 0; diff --git a/app/event.php b/app/event.php index 84bdd715..3df7b9fe 100644 --- a/app/event.php +++ b/app/event.php @@ -56,7 +56,7 @@ return [ \crmeb\listens\SendSvipCouponListen::class, \crmeb\listens\SyncMerchantMarginStatusListen::class, \crmeb\listens\SyncQueueStatusListen::class, - \crmeb\listens\ActivateCouponListen::class, +// \crmeb\listens\ActivateCouponListen::class, \crmeb\listens\SetProductProfitRateListen::class, \crmeb\listens\SendSubsidyCouponListen::class, ] : [], diff --git a/crmeb/listens/AutoSendPayOrderSmsListen.php b/crmeb/listens/AutoSendPayOrderSmsListen.php index 861aef31..4ef55628 100644 --- a/crmeb/listens/AutoSendPayOrderSmsListen.php +++ b/crmeb/listens/AutoSendPayOrderSmsListen.php @@ -27,6 +27,7 @@ class AutoSendPayOrderSmsListen extends TimerService implements ListenerInterfac public function handle($event): void { $this->tick(1000 * 60 * 5, function () { + /** @var StoreGroupOrderRepository $storeGroupOrderRepository */ $storeGroupOrderRepository = app()->make(StoreGroupOrderRepository::class); $time = date('Y-m-d H:i:s', strtotime("- 10 minutes")); $groupOrderIds = $storeGroupOrderRepository->getTimeOutIds($time, true); diff --git a/crmeb/listens/AutoUnlockMerchantMoneyListen.php b/crmeb/listens/AutoUnlockMerchantMoneyListen.php index 68ce5969..dff917d2 100644 --- a/crmeb/listens/AutoUnlockMerchantMoneyListen.php +++ b/crmeb/listens/AutoUnlockMerchantMoneyListen.php @@ -25,13 +25,13 @@ class AutoUnlockMerchantMoneyListen extends TimerService implements ListenerInte public function handle($event): void { $this->tick(1000 * 60 * 60, function () { - if (time() >= strtotime('today 18:00:00') && time() <= strtotime('today 20:00:00')) { + if (time() >= strtotime('today 00:00:00') && time() <= strtotime('today 02:00:00')) { request()->clearCache(); /** @var UserBillRepository $userBill */ $userBill = app()->make(UserBillRepository::class); // $timer = ((int)systemConfig('mer_lock_time')); // $time = date('Y-m-d H:i:s', $timer ? strtotime("- $timer day") : time()); - $time = date('Y-m-d 00:00:00'); + $time = date('Y-m-d 00:00:00', strtotime('-1 day')); $bills = $userBill->getTimeoutMerchantMoneyBill($time); $merchant = app()->make(MerchantRepository::class); $count = 0;