update
This commit is contained in:
parent
a7c5bd3390
commit
e56acef076
@ -165,7 +165,7 @@ class UserController extends BaseApiController
|
|||||||
public function getCurrCycleWithdraw()
|
public function getCurrCycleWithdraw()
|
||||||
{
|
{
|
||||||
$userInfo = User::find(['id' => $this->userId]);
|
$userInfo = User::find(['id' => $this->userId]);
|
||||||
// 数据字典 提前周期 单位:天数
|
// 数据字典 提现周期 单位:天数
|
||||||
$dictData = ConfigLogic::getDictByType('withdraw_cycle');
|
$dictData = ConfigLogic::getDictByType('withdraw_cycle');
|
||||||
$endCycle = strtotime(date('Y-m-d', strtotime("-{$dictData['withdraw_cycle'][0]['value']} day")));
|
$endCycle = strtotime(date('Y-m-d', strtotime("-{$dictData['withdraw_cycle'][0]['value']} day")));
|
||||||
// 计算公司周期内所有用户已完成的 变动类型为任务收益金额增加 动作为增加的 未提现状态 的变动金额之和
|
// 计算公司周期内所有用户已完成的 变动类型为任务收益金额增加 动作为增加的 未提现状态 的变动金额之和
|
||||||
@ -175,6 +175,9 @@ class UserController extends BaseApiController
|
|||||||
public function withdraw()
|
public function withdraw()
|
||||||
{
|
{
|
||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
|
if(!isset($params['amount'])) {
|
||||||
|
return $this->fail('参数错误');
|
||||||
|
}
|
||||||
$params['user_id'] = $this->userId;
|
$params['user_id'] = $this->userId;
|
||||||
$result = UserLogic::withdraw($params);
|
$result = UserLogic::withdraw($params);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
@ -302,6 +302,7 @@ class UserLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
$user = User::findOrEmpty($params['user_id']);
|
$user = User::findOrEmpty($params['user_id']);
|
||||||
|
|
||||||
if ($user->isEmpty()) {
|
if ($user->isEmpty()) {
|
||||||
throw new DataNotFoundException('用户不存在');
|
throw new DataNotFoundException('用户不存在');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user