处理下单校验的错误

This commit is contained in:
luofei 2024-03-18 09:21:45 +08:00
parent 91d3a0078d
commit 3be0a42dc4
6 changed files with 7 additions and 4 deletions

View File

@ -106,7 +106,7 @@ class StoreCartDao extends BaseDao
->append(['bc_extension_one', 'bc_extension_two']); ->append(['bc_extension_one', 'bc_extension_two']);
}, },
'merchant' => function (Relation $query) use ($uid) { '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([ ->with([
'coupon' => function ($query) use ($uid) { 'coupon' => function ($query) use ($uid) {
$query->where('uid', $uid); $query->where('uid', $uid);

View File

@ -1454,6 +1454,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
*/ */
protected function validateCartList($cartId,$address,$user) protected function validateCartList($cartId,$address,$user)
{ {
/** @var storeCartRepository $storeCartRepository */
$storeCartRepository = app()->make(storeCartRepository::class); $storeCartRepository = app()->make(storeCartRepository::class);
$cartData = $storeCartRepository->cartIbByData($cartId, $user->uid, $address); $cartData = $storeCartRepository->cartIbByData($cartId, $user->uid, $address);
$res = $storeCartRepository->checkCartList($cartData, 0, $user); $res = $storeCartRepository->checkCartList($cartData, 0, $user);

View File

@ -375,6 +375,7 @@ class Merchant extends BaseController
if (empty($merchantInfo)) { if (empty($merchantInfo)) {
return app('json')->fail('参数错误'); 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); $merchantInfo['unpaid_margin'] = bcsub($merchantInfo['margin'], $merchantInfo['paid_margin'], 2);
if ($merchantInfo['margin'] <= 0) { if ($merchantInfo['margin'] <= 0) {
$merchantInfo['unpaid_margin'] = 0; $merchantInfo['unpaid_margin'] = 0;

View File

@ -56,7 +56,7 @@ return [
\crmeb\listens\SendSvipCouponListen::class, \crmeb\listens\SendSvipCouponListen::class,
\crmeb\listens\SyncMerchantMarginStatusListen::class, \crmeb\listens\SyncMerchantMarginStatusListen::class,
\crmeb\listens\SyncQueueStatusListen::class, \crmeb\listens\SyncQueueStatusListen::class,
\crmeb\listens\ActivateCouponListen::class, // \crmeb\listens\ActivateCouponListen::class,
\crmeb\listens\SetProductProfitRateListen::class, \crmeb\listens\SetProductProfitRateListen::class,
\crmeb\listens\SendSubsidyCouponListen::class, \crmeb\listens\SendSubsidyCouponListen::class,
] : [], ] : [],

View File

@ -27,6 +27,7 @@ class AutoSendPayOrderSmsListen extends TimerService implements ListenerInterfac
public function handle($event): void public function handle($event): void
{ {
$this->tick(1000 * 60 * 5, function () { $this->tick(1000 * 60 * 5, function () {
/** @var StoreGroupOrderRepository $storeGroupOrderRepository */
$storeGroupOrderRepository = app()->make(StoreGroupOrderRepository::class); $storeGroupOrderRepository = app()->make(StoreGroupOrderRepository::class);
$time = date('Y-m-d H:i:s', strtotime("- 10 minutes")); $time = date('Y-m-d H:i:s', strtotime("- 10 minutes"));
$groupOrderIds = $storeGroupOrderRepository->getTimeOutIds($time, true); $groupOrderIds = $storeGroupOrderRepository->getTimeOutIds($time, true);

View File

@ -25,13 +25,13 @@ class AutoUnlockMerchantMoneyListen extends TimerService implements ListenerInte
public function handle($event): void public function handle($event): void
{ {
$this->tick(1000 * 60 * 60, function () { $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(); request()->clearCache();
/** @var UserBillRepository $userBill */ /** @var UserBillRepository $userBill */
$userBill = app()->make(UserBillRepository::class); $userBill = app()->make(UserBillRepository::class);
// $timer = ((int)systemConfig('mer_lock_time')); // $timer = ((int)systemConfig('mer_lock_time'));
// $time = date('Y-m-d H:i:s', $timer ? strtotime("- $timer day") : 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); $bills = $userBill->getTimeoutMerchantMoneyBill($time);
$merchant = app()->make(MerchantRepository::class); $merchant = app()->make(MerchantRepository::class);
$count = 0; $count = 0;