From fd161f381d92a5dd2e7a40172c2ee02242fcd955 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Sat, 16 Mar 2024 11:45:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E6=88=B7=E5=86=BB?= =?UTF-8?q?=E7=BB=93=E9=87=91=E8=BD=AC=E8=B4=A6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/product/SpuRepository.php | 8 ++++++++ crmeb/listens/AutoUnlockMerchantMoneyListen.php | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/store/product/SpuRepository.php b/app/common/repositories/store/product/SpuRepository.php index 5c9368e3..d796649e 100755 --- a/app/common/repositories/store/product/SpuRepository.php +++ b/app/common/repositories/store/product/SpuRepository.php @@ -12,6 +12,7 @@ namespace app\common\repositories\store\product; use app\common\model\store\product\CloudProduct; use app\common\model\store\product\Product; +use app\common\model\system\merchant\Merchant; use app\common\repositories\store\coupon\StoreCouponProductRepository; use app\common\repositories\store\coupon\StoreCouponRepository; use app\common\repositories\store\StoreActivityRepository; @@ -167,6 +168,13 @@ class SpuRepository extends BaseRepository unset($where['order_remark']); $count = $queryCount->count(); + if (isset($where['mer_id'])) { + $typeId = Merchant::where('mer_id', $where['mer_id'])->value('type_id'); + $isOfficialStore = $typeId == 22; + } + if (isset($isOfficialStore) && $isOfficialStore) { + $where['order'] = 'price_asc'; + } $query = $this->dao->search($where); $query->with([ diff --git a/crmeb/listens/AutoUnlockMerchantMoneyListen.php b/crmeb/listens/AutoUnlockMerchantMoneyListen.php index 68ce5969..dff917d2 100755 --- 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;