From ad8905312f6f0077a5ff8485d54d261b33c14108 Mon Sep 17 00:00:00 2001 From: fengxinyhyl Date: Thu, 18 Apr 2024 10:36:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E6=88=B7=E4=BF=A1=E6=81=AF=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../merchant/FinancialRecordRepository.php | 28 +++ .../merchant/MerchantCategoryRepository.php | 2 +- .../admin/system/merchant/Merchant.php | 2 + app/controller/api/Auth.php | 2 + .../src/views/merchant/classify/index.vue | 5 - .../merchant/list/handle/merEditForm.vue | 130 +++++------- .../views/merchant/list/handle/merInfo.vue | 197 ++++++------------ view/admin/src/views/merchant/list/index.vue | 18 +- 8 files changed, 154 insertions(+), 230 deletions(-) diff --git a/app/common/repositories/system/merchant/FinancialRecordRepository.php b/app/common/repositories/system/merchant/FinancialRecordRepository.php index 611c724..7774514 100755 --- a/app/common/repositories/system/merchant/FinancialRecordRepository.php +++ b/app/common/repositories/system/merchant/FinancialRecordRepository.php @@ -17,8 +17,10 @@ namespace app\common\repositories\system\merchant; use app\common\dao\system\merchant\FinancialRecordDao; use app\common\repositories\BaseRepository; use app\common\repositories\store\order\StoreOrderRepository; +use app\common\repositories\user\UserAssetsRepository; use app\common\repositories\user\UserBillRepository; use app\common\repositories\user\UserRechargeRepository; +use app\common\repositories\user\UserRepository; use think\facade\Cache; use think\facade\Db; @@ -39,6 +41,32 @@ class FinancialRecordRepository extends BaseRepository $this->dao = $dao; } + public function getMerchantStatistics($where){ + //商户收入 + $count = $this->dao->search($where)->where('financial_type','in',['order','mer_presell'])->sum('number'); + + //商户余额 + $mer_money = app()->make(MerchantRepository::class)->search(['mer_id' => $where['mer_id']])->value('mer_money'); + //最低提现额度 + $extract_minimum_line = systemConfig('extract_minimum_line'); + //商户可提现金额 + $_line = bcsub($mer_money,$extract_minimum_line,2); + $_line = max($_line, 0); + //退款支出金额 + $refund_order = $this->dao->search($where)->where('financial_type','refund_order')->sum('number'); + + //商户冻结金额 + $merLockMoney = app()->make(UserBillRepository::class)->merchantLickMoney($where['mer_id']); + + return array( + 'total' => $count, + 'mer_money' => $mer_money, + 'frozen_money' => $merLockMoney, + 'refund_money' => $refund_order, + 'available_money' => $_line, + ); + } + /** * TODO 列表 * @param array $where diff --git a/app/common/repositories/system/merchant/MerchantCategoryRepository.php b/app/common/repositories/system/merchant/MerchantCategoryRepository.php index b45c8b4..44ad5d5 100755 --- a/app/common/repositories/system/merchant/MerchantCategoryRepository.php +++ b/app/common/repositories/system/merchant/MerchantCategoryRepository.php @@ -83,7 +83,7 @@ class MerchantCategoryRepository extends BaseRepository $form = Elm::createForm($action, [ Elm::input('category_name', '分类名称:')->placeholder('请输入分类名称')->required(), - Elm::number('commission_rate', '手续费(%):', 0)->required()->max(100)->precision(2) +// Elm::number('commission_rate', '手续费(%):', 0)->required()->max(100)->precision(2) ]); return $form->formData($formData)->setTitle(is_null($id) ? '添加商户分类' : '编辑商户分类'); diff --git a/app/controller/admin/system/merchant/Merchant.php b/app/controller/admin/system/merchant/Merchant.php index 1fcd6ec..d717398 100755 --- a/app/controller/admin/system/merchant/Merchant.php +++ b/app/controller/admin/system/merchant/Merchant.php @@ -16,6 +16,7 @@ namespace app\controller\admin\system\merchant; use app\common\repositories\store\product\ProductCopyRepository; use app\common\repositories\store\service\StoreServiceRepository; +use app\common\repositories\system\merchant\FinancialRecordRepository; use app\common\repositories\system\merchant\MerchantTypeRepository; use app\common\repositories\system\operate\OperateLogRepository; use app\common\repositories\user\UserBillRepository; @@ -355,6 +356,7 @@ class Merchant extends BaseController public function detail($id) { $data = $this->repository->adminDetail($id); + $data['assets'] = \app(FinancialRecordRepository::class)->getMerchantStatistics(array('mer_id' => $id)); return app('json')->success($data); } diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index e1cbe1a..bf3b35c 100755 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -190,6 +190,8 @@ class Auth extends BaseController // 用户资产 $assets = app(UserAssetsRepository::class)->assets($data['uid']); $data['assets'] = $assets; + $data['service'] = null; + $data['topService'] = null; return app('json')->success($data); } diff --git a/view/admin/src/views/merchant/classify/index.vue b/view/admin/src/views/merchant/classify/index.vue index 5d4b07a..d6b4f0b 100644 --- a/view/admin/src/views/merchant/classify/index.vue +++ b/view/admin/src/views/merchant/classify/index.vue @@ -20,11 +20,6 @@ label="分类名称" min-width="150" /> - -
-
费用信息
- - - - {{merData.is_margin == 0 ? '无' : merData.ot_margin+'元'}} - - - - - {{merData.is_margin == 1 ? '待缴' : merData.is_margin == 0 ? '无' : '已缴' }} - - - - - {{merData.margin}} - - - - - - - % - -
(注:此处如未设置手续费,系统会自动读取商户分类下对应手续费;此处已设置,则优先以此处设置为准)
-
-
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
审核信息
@@ -190,30 +190,6 @@ /> - - - - - - - - - -
@@ -231,15 +207,8 @@ - - - - - 修改 - - - -
+ +
@@ -310,9 +279,9 @@ - + - +