From 6674cd6b28e140e51a858c7795e96d1f25e89360 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 21 Mar 2024 13:42:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/merchant/MerchantIntention.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 07f170a2..3ae13ae2 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -364,6 +364,7 @@ class MerchantIntention extends BaseController $v['mer_avatar'] = Merchant::getDB()->where('uid',$v['uid'])->value('mer_avatar'); $v['check_name'] = "小方"; $v['check_phone'] = "18715236963"; + $v['check_avatar'] = "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/56d04202403211340336015.png"; } return app('json')->success($list); From 473314def9f6195f091848e0f88082213d59b8b2 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 21 Mar 2024 14:40:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=95=B4=E5=90=88=E5=95=86=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/merchant/MerchantRepository.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/common/repositories/system/merchant/MerchantRepository.php b/app/common/repositories/system/merchant/MerchantRepository.php index c9738c99..f8e69163 100644 --- a/app/common/repositories/system/merchant/MerchantRepository.php +++ b/app/common/repositories/system/merchant/MerchantRepository.php @@ -360,10 +360,12 @@ class MerchantRepository extends BaseRepository */ public function detail($id, $userInfo) { - $merchant = $this->dao->apiGetOne($id)->hidden([ - "real_name", "mer_phone", "reg_admin_id", "sort", "is_del", "is_audit", "is_best", "mer_state", "bank", "bank_number", "bank_name", 'update_time', - 'financial_alipay', 'financial_bank', 'financial_wechat', 'financial_type','mer_take_phone' - ]); + $merchant = $this->dao->apiGetOne($id); + $merchant['info'] = $merchant->mer_info; +// ->hidden([ +// "real_name", "mer_phone", "reg_admin_id", "sort", "is_del", "is_audit", "is_best", "mer_state", "bank", "bank_number", "bank_name", 'update_time', +// 'financial_alipay', 'financial_bank', 'financial_wechat', 'financial_type','mer_take_phone' +// ]); $merchant->append(['type_name', 'isset_certificate', 'services_type']); $merchant['care'] = false; $merchant['mer_info'] = merchantConfig($merchant['mer_id'], [ From b3408a8ff58a3fea6d13c61cf126e20c11ff8d47 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 21 Mar 2024 15:46:46 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/store/order/StoreOrderDao.php | 10 ++++++++ .../api/store/merchant/Merchant.php | 25 +++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/app/common/dao/store/order/StoreOrderDao.php b/app/common/dao/store/order/StoreOrderDao.php index fabe6266..f142d227 100644 --- a/app/common/dao/store/order/StoreOrderDao.php +++ b/app/common/dao/store/order/StoreOrderDao.php @@ -212,6 +212,14 @@ class StoreOrderDao extends BaseDao $query->whereLike('StoreOrder.real_name|StoreOrder.user_phone|order_sn', "%" . $where['keywords'] . "%"); }); }) + ->when(isset($where['order_search']) && $where['order_search'] !== '', function ($query) use ($where) { + // 对 order_sn 进行模糊搜索 + $query->where(function ($q) use ($where) { + $q->whereLike('StoreOrder.order_sn', '%' . $where['order_search'] . '%') + ->whereOr('StoreOrder.user_phone', 'like', '%' . $where['order_search'] . '%'); + }); + + }) ->when(isset($where['filter_delivery']) && $where['filter_delivery'] !== '', function ($query) use ($where) { //1 快递 2 配送 3 虚拟 //按发货方式:1快递订单、2配送订单、4核销订单、3虚拟发货、6自动发货 @@ -252,6 +260,8 @@ class StoreOrderDao extends BaseDao }) ->order('StoreOrder.create_time DESC'); + + return $query; } diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index 5f4a3971..ceeaafb4 100644 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -15,6 +15,7 @@ namespace app\controller\api\store\merchant; use app\common\model\system\merchant\MerchantType; use app\common\repositories\store\MerchantTakeRepository; use app\common\repositories\store\product\ProductRepository; +use app\common\repositories\system\attachment\AttachmentRepository; use app\common\repositories\system\config\ConfigValueRepository; use app\common\repositories\system\financial\FinancialRepository; use app\common\repositories\system\merchant\MerchantRepository; @@ -24,6 +25,7 @@ use app\validate\merchant\MerchantFinancialAccountValidate; use app\validate\merchant\MerchantTakeValidate; use app\validate\merchant\MerchantUpdateValidate; use crmeb\jobs\ChangeMerchantStatusJob; +use crmeb\services\QrcodeService; use think\App; use crmeb\basic\BaseController; use app\common\repositories\system\merchant\MerchantRepository as repository; @@ -128,9 +130,28 @@ class Merchant extends BaseController public function qrcode($id) { - if(!$this->repository->merExists((int)$id)) + if (!$this->repository->merExists($id)) return app('json')->fail('店铺已打烊'); - $url = $this->request->param('type') == 'routine' ? $this->repository->routineQrcode(intval($id)) : $this->repository->wxQrcode(intval($id)); + if ($this->request->param('type') == 'routine') { + $url = $this->repository->routineQrcode(intval($id)); + } elseif ($this->request->param('type') == 'app') { + $attachmentRepository = app()->make(AttachmentRepository::class); + $name = 'merchant_code_' . $id . '.png'; + $imageInfo = $attachmentRepository->getWhere(['attachment_name' => $name]); + if ($imageInfo) { + $url = $imageInfo['attachment_src']; + } else { + $info = app()->make(QrcodeService::class)->getQRCodePath(systemConfig('site_url') . 'pages/store/home/index?id=' . $id, $name); + $attachmentRepository->create(systemConfig('upload_type') ?: 1, -2, $id, [ + 'attachment_category_id' => 0, + 'attachment_name' => $info['name'], + 'attachment_src' => $info['dir'] + ]); + $url = $info['dir']; + } + } else { + $url = $this->repository->wxQrcode(intval($id)); + } return app('json')->success(compact('url')); } From aed6a946a3cdf4a34baac187b283198b89df38c9 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 21 Mar 2024 15:52:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=8E=A5=E5=8F=97?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/server/StoreOrder.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/controller/api/server/StoreOrder.php b/app/controller/api/server/StoreOrder.php index e4e5ef41..f63770f4 100644 --- a/app/controller/api/server/StoreOrder.php +++ b/app/controller/api/server/StoreOrder.php @@ -87,8 +87,20 @@ class StoreOrder extends BaseController $where['search'] = $this->request->param('store_name'); $where['mer_id'] = $merId; $where['is_del'] = 0; - if($where['status'] == 2) $where['order_type'] = 0; - return app('json')->success($repository->merchantGetList($where, $page, $limit)); + $where['pay_time'] = $this->request->param('pay_time'); + $where['product_type'] = $this->request->param('product_type',0); + if ($where['product_type']==0){ + unset($where['product_type']); + } + $where['order_search'] = $this->request->param('search_info'); + $repository = \app()->make(StoreOrderRepository::class); + $result = $repository->merchantGetList($where, $page, $limit); + + foreach ($result['list'] as &$item) { + $item['pay_price'] = $item['consumption_money'] > 0 ? bcadd($item['pay_price'], $item['consumption_money'], 2) : $item['pay_price']; + } + + return app('json')->success($result); } public function order($merId, $id, StoreOrderRepository $repository)