liudan 10 months ago
commit cec9276f4f
  1. 2
      app/common/dao/user/UserDao.php
  2. 4
      app/common/repositories/system/HuitongRepository.php
  3. 1
      app/common/repositories/system/merchant/FinancialRecordRepository.php
  4. 6
      app/common/repositories/user/UserAssetsLogRepository.php
  5. 3
      app/controller/admin/system/merchant/Merchant.php
  6. 2
      app/controller/admin/user/User.php
  7. 2
      app/controller/api/user/User.php
  8. 3
      app/validate/admin/MerchantValidate.php

@ -85,6 +85,8 @@ class UserDao extends BaseDao
});
})->when(isset($where['status']) && $where['status'] !== '', function (BaseQuery $query) use ($where) {
return $query->where('User.status', intval($where['status']));
})->when(isset($where['mer_id']) && $where['mer_id'] !== '', function (BaseQuery $query) use ($where) {
return $query->where('User.mer_id', intval($where['mer_id']));
})->when(isset($where['group_id']) && $where['group_id'], function (BaseQuery $query) use ($where) {
return $query->where('User.group_id', intval($where['group_id']));
})->when(isset($where['brokerage_level']) && $where['brokerage_level'], function (BaseQuery $query) use ($where) {

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

@ -209,6 +209,7 @@ class FinancialRecordRepository extends BaseRepository
$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');

@ -197,6 +197,7 @@ class UserAssetsLogRepository extends BaseRepository
$welfare = $consume = $huitong = $contribution = 0;
$consume = round($orderItem['total_price'] * $orderItem['commission_rate'] / 100, 2);
$consume = $this->_getValue($consume);
Log::info("+++++++++++++merchantAndPlatformAssets uid is ".$user['uid']);
$logList[] = array(
'uid' => $user['uid'],
'asset_type' => self::ASSET_TYPE_CONSUME,
@ -749,6 +750,9 @@ class UserAssetsLogRepository extends BaseRepository
foreach ($data as $item) {
$item['type'] = $changeType[$item['type']] ?? '未知';
$item['asset_type'] = $assetsType[$item['asset_type']] ?? '未知';
if($item['status'] == self::STATUS_REFUND){
$item['type'] .= '(已退款)';
}
if($item['count'] > 0){
$item['count'] = "+".$item['count'];
}
@ -757,7 +761,7 @@ class UserAssetsLogRepository extends BaseRepository
$item['user_nickname'] = $user['nickname'];
$item['user_phone'] = $user['phone'];
}else{
$item['user_nickname'] = '未知';
$item['user_nickname'] = '平台';
$item['user_phone'] = '未知';
}
$list[] = $item;

@ -31,6 +31,7 @@ use think\App;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\facade\Log;
use think\facade\Queue;
/**
@ -153,7 +154,7 @@ class Merchant extends BaseController
return app('json')->fail('请输入正确的手机号');
if (!$data['category_id'] || !$merchantCategoryRepository->exists($data['category_id']))
return app('json')->fail('商户分类不存在');
Log::info("+++++++++++merchant-update ". json_encode($data));
unset($data['mer_account'], $data['mer_password']);
$margin = $this->repository->checkMargin($id, $data['type_id']);
$data['margin'] = $margin['margin'];

@ -269,7 +269,7 @@ class User extends BaseController
$where[] = array('create_time','between',[date('Y-m-d', strtotime($date[0])),date('Y-m-d', strtotime($date[1]) +86400)]);
}
if($user) $where[] = array('uid','=',$user['uid']);
$where[] = array('status','in',[UserAssetsLogRepository::STATUS_FROZEN, UserAssetsLogRepository::STATUS_SUCCESS, UserAssetsLogRepository::STATUS_USED]);
$where[] = array('status','in',[UserAssetsLogRepository::STATUS_FROZEN, UserAssetsLogRepository::STATUS_SUCCESS, UserAssetsLogRepository::STATUS_USED, UserAssetsLogRepository::STATUS_REFUND]);
return app('json')->success(app(UserAssetsLogRepository::class)->list(0, $where, $page, $limit));
}

@ -59,7 +59,7 @@ class User extends BaseController
$where = array();
$where[] = array('asset_type','=',$asset_type);
if($change_type) $where[] = array('type','=',$change_type);
$where[] = array('status','in',[UserAssetsLogRepository::STATUS_FROZEN, UserAssetsLogRepository::STATUS_SUCCESS, UserAssetsLogRepository::STATUS_USED]);
$where[] = array('status','in',[UserAssetsLogRepository::STATUS_FROZEN, UserAssetsLogRepository::STATUS_SUCCESS, UserAssetsLogRepository::STATUS_USED, UserAssetsLogRepository::STATUS_REFUND]);
return app('json')->success(app(UserAssetsLogRepository::class)->list($uid, $where, $page, $limit));
}

@ -50,7 +50,8 @@ class MerchantValidate extends Validate
'is_bro_goods|直播商品状态' => 'require|in:0,1',
'is_bro_room|直播间状态' => 'require|in:0,1',
'is_trader|自营状态' => 'require|in:0,1',
'commission_rate|提成比例' => '>=:0'
'commission_rate|提成比例' => '>=:0',
'district_id|所属区域' =>'>=:0'
];
/**

Loading…
Cancel
Save