优化代码

main
home.fengxinyhyl 8 months ago
parent 9dcfb303b4
commit 1cef1bddfa
  1. 4
      app/common/repositories/system/HuitongRepository.php
  2. 1
      app/common/repositories/system/merchant/FinancialRecordRepository.php
  3. 2
      app/common/repositories/user/UserAssetsLogRepository.php

@ -16,6 +16,7 @@ use app\common\dao\system\HuitongDao;
use app\common\repositories\BaseRepository; use app\common\repositories\BaseRepository;
use app\common\repositories\store\order\StoreOrderBaseRepository; use app\common\repositories\store\order\StoreOrderBaseRepository;
use app\common\repositories\user\UserAssetsRepository; use app\common\repositories\user\UserAssetsRepository;
use think\facade\Log;
/** /**
@ -48,10 +49,11 @@ class HuitongRepository extends BaseRepository
* @var StoreOrderBaseRepository $orderBase * @var StoreOrderBaseRepository $orderBase
*/ */
$orderBase = app()->make(StoreOrderBaseRepository::class); $orderBase = app()->make(StoreOrderBaseRepository::class);
$count = $orderBase->getTotalBase(); $count = $orderBase->getTotalBase(date('Y-m-d', strtotime('-1day')));
if (empty($count)) { if (empty($count)) {
return; return;
} }
Log::info("+++++++");
$base = round($config['huitong_add'] * $count / 100, 2); $base = round($config['huitong_add'] * $count / 100, 2);
if ($base < 0.01) { if ($base < 0.01) {
$base = 0.01; $base = 0.01;

@ -209,6 +209,7 @@ class FinancialRecordRepository extends BaseRepository
$extract_minimum_line = systemConfig('extract_minimum_line'); $extract_minimum_line = systemConfig('extract_minimum_line');
//商户可提现金额 //商户可提现金额
$_line = bcsub($mer_money,$extract_minimum_line,2); $_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'); $refund_order = $this->dao->search($where)->where('financial_type','refund_order')->sum('number');

@ -761,7 +761,7 @@ class UserAssetsLogRepository extends BaseRepository
$item['user_nickname'] = $user['nickname']; $item['user_nickname'] = $user['nickname'];
$item['user_phone'] = $user['phone']; $item['user_phone'] = $user['phone'];
}else{ }else{
$item['user_nickname'] = '未知'; $item['user_nickname'] = '平台';
$item['user_phone'] = '未知'; $item['user_phone'] = '未知';
} }
$list[] = $item; $list[] = $item;

Loading…
Cancel
Save