1748153932 1 year ago
parent ba048e8e33
commit 10a1f97eec
  1. 5
      app/common/repositories/user/UserExtractRepository.php
  2. 13
      app/common/repositories/user/UserLabelRepository.php
  3. 4
      app/common/repositories/user/UserRepository.php

@ -102,8 +102,11 @@ class UserExtractRepository extends BaseRepository
{
event('user.extract.before', compact('user', 'data'));
$userExtract = Db::transaction(function () use ($user, $data) {
if ($user['hp_value'] < (systemConfig('user_extract_min')))
throw new ValidateException('生命值不足,无法提现');
if ($user['brokerage_price'] < (systemConfig('user_extract_min')))
throw new ValidateException('可提现金额不足');
throw new ValidateException('可提增值积分不足');
if ($data['extract_price'] < (systemConfig('user_extract_min')))
throw new ValidateException('提现金额不得小于最低额度');
if ($user['brokerage_price'] < $data['extract_price'])

@ -16,7 +16,9 @@ namespace app\common\repositories\user;
use app\common\dao\user\UserLabelDao;
use app\common\repositories\BaseRepository;
use app\common\repositories\store\CityAreaRepository;
use FormBuilder\Exception\FormBuilderException;
use app\controller\admin\store\StoreBrand;
use FormBuilder\Factory\Elm;
use FormBuilder\Form;
use think\db\exception\DataNotFoundException;
@ -88,11 +90,10 @@ class UserLabelRepository extends BaseRepository
$isCreate = is_null($id);
$action = Route::buildUrl($isCreate ? 'systemUserLabelCreate' : 'systemUserLabelUpdate', $isCreate ? [] : compact('id'))->build();
$area = [
['value' => '', 'label' => '全部'],
['value' => 1, 'label' => '自营'],
['value' => 0, 'label' => '非自营'],
];
$StoreBrand = new CityAreaRepository();
$where['parent_id'] = 0;
$area =$StoreBrand->getList($where);
return Elm::createForm($action, [
@ -117,8 +118,6 @@ class UserLabelRepository extends BaseRepository
Elm::input('brand_id', '品牌')->required(),
Elm::input('trade_id', '行业')->required(),
])->setTitle($isCreate ? '添加合作人' : '编辑合作人')->formData($formData);
}

@ -145,6 +145,7 @@ class UserRepository extends BaseRepository
}
return $options;
}),
Elm::selectMultiple('label_id', '用户标签')->options(function () {
$data = app()->make(UserLabelRepository::class)->allOptions();
$options = [];
@ -154,6 +155,9 @@ class UserRepository extends BaseRepository
}
return $options;
}),
Elm::radio('status', '状态', 1)->options([
['value' => 0, 'label' => '关闭'],
['value' => 1, 'label' => '开启'],

Loading…
Cancel
Save