This commit is contained in:
luofei 2024-03-21 16:19:26 +08:00
commit 541990a1b2
5 changed files with 54 additions and 8 deletions

View File

@ -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;
}

View File

@ -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'], [

View File

@ -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)

View File

@ -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'));
}

View File

@ -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);