diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index a8a74493..a6494276 100755 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -940,7 +940,7 @@ class Auth extends BaseController if ($code && ($info = app()->make(RoutineQrcodeRepository::class)->getRoutineQrcodeFindType($code))) { $auth['auth']['spread'] = $info['third_id']; } - if (!$user || empty($user['account'])) { + if (!$user || empty($user['account']) || empty($user['phone'])) { $uni = uniqid(true, false) . random_int(1, 100000000); $key = 'U' . md5(time() . $uni); Cache::set('u_try' . $key, ['id' => $authInfo['wechat_user_id'], 'type' => $authInfo['user_type'], 'spread' => $auth['auth']['spread'] ?? 0], 3600); @@ -1696,7 +1696,7 @@ class Auth extends BaseController return app('json')->fail('授权已过期,请重新登录'); } $user = $repository->wechatUserIdBytUser($auth['id']); - if (!empty($user['account'])) { + if (!empty($user['account']) && !empty($user['phone'])) { return app('json')->fail('已绑定手机号'); } $targetUser = $repository->accountByUser($data['phone']); diff --git a/app/controller/api/server/StoreOrder.php b/app/controller/api/server/StoreOrder.php index 571d5182..7feaef9f 100755 --- a/app/controller/api/server/StoreOrder.php +++ b/app/controller/api/server/StoreOrder.php @@ -405,14 +405,14 @@ class StoreOrder extends BaseController return app('json')->success($list); } - + /** * 获取商户押金列表 */ public function getOrderAutoMarginList($merId){ [$page, $limit] = $this->getPage(); - $select= Db::name('financial_record')->where('mer_id',$merId)->where('type',1) - ->where('financial_type','auto_margin')->where('financial_pm',0) + $select= Db::name('financial_record')->where('mer_id',$merId) + ->where('financial_type','auto_margin') ->page($page)->limit($limit)->order('financial_record_id','desc')->select(); return app('json')->success($select); diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index a0b046a4..fe71060d 100755 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -301,10 +301,10 @@ class Merchant extends BaseController if (empty($merchantInfo)) { return app('json')->fail('参数错误'); } - $margin = Db::name('MerchantType')->where('mer_type_id', $merchantInfo['type_id'])->value('margin'); - $merchantInfo['unpaid_margin'] = bcsub($margin, $merchantInfo['paid_margin'], 2); - if ($merchantInfo['margin'] == 0) { - $merchantInfo['margin'] = $merchantInfo['unpaid_margin']; + $merchantInfo['unpaid_margin'] = bcsub($merchantInfo['margin'], $merchantInfo['paid_margin'], 2); + if ($merchantInfo['margin'] <= 0) { + $merchantInfo['unpaid_margin'] = 0; + $merchantInfo['paid_margin'] = 0; } return app('json')->success($merchantInfo); } diff --git a/crmeb/listens/AutoUnlockMerchantMoneyListen.php b/crmeb/listens/AutoUnlockMerchantMoneyListen.php index a58f2248..68ce5969 100755 --- a/crmeb/listens/AutoUnlockMerchantMoneyListen.php +++ b/crmeb/listens/AutoUnlockMerchantMoneyListen.php @@ -25,7 +25,7 @@ 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 18:00:00') && time() <= strtotime('today 20:00:00')) { request()->clearCache(); /** @var UserBillRepository $userBill */ $userBill = app()->make(UserBillRepository::class);