优化代码

This commit is contained in:
邹景立 2021-05-19 19:07:07 +08:00
parent f4f6049b28
commit 5eb2439e01
6 changed files with 6 additions and 6 deletions

View File

@ -105,7 +105,7 @@ class Admin extends Controller
$map = $this->_vali(['id.require' => '用户ID不能为空']);
$user = $this->app->db->name($this->table)->where($map)->find();
if (empty($user) || empty($user['pid0'])) $this->error('用户不符合操作要求!');
[$status, $message] = UserUpgradeService::instance()->bindAgent($user['id'], $user['pid0'], 1);
[$status, $message] = UserUpgradeService::instance()->bindAgent($user['id'], $user['pid0']);
$status && sysoplog('前端用户管理', "后台修改用户[{$map['id']}]的代理为永久状态");
empty($status) ? $this->error($message) : $this->success($message);
}

View File

@ -65,7 +65,7 @@ class Transfer extends Controller
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
private function _sysdata($tpl = '')
private function _sysdata(string $tpl = '')
{
if ($this->request->isGet()) {
$this->data = sysdata($this->skey);

View File

@ -58,7 +58,7 @@ class OrderService extends Service
// 尝试绑定代理用户
if (empty($user['pids']) && ($order['puid1'] > 0 || $user['pid1'] > 0)) {
$puid1 = $order['puid1'] > 0 ? $order['puid1'] : $user['pid0'];
UserUpgradeService::instance()->bindAgent($user['id'], $puid1, 1);
UserUpgradeService::instance()->bindAgent($user['id'], $puid1);
}
// 重置用户信息并绑定订单
$user = $this->app->db->name('DataUser')->where(['id' => $order['uid']])->find();

View File

@ -65,7 +65,7 @@ class UserUpgradeService extends Service
}
}
// 更新用户等级
$this->upgrade($user['id'], true);
$this->upgrade($user['id']);
$result = [1, '绑定代理成功'];
});
return $result;

View File

@ -163,7 +163,7 @@ class JoinpayPaymentService extends PaymentService
protected function initialize(): JoinpayPaymentService
{
$this->appid = $this->params['joinpay_appid'];
$this->trade = $this->params['joinpay_trade'];;
$this->trade = $this->params['joinpay_trade'];
$this->mchid = $this->params['joinpay_mch_id'];
$this->mchkey = $this->params['joinpay_mch_key'];
return $this;

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2021-05-19 18:51:50
// This file is automatically generated at:2021-05-19 19:06:53
declare (strict_types = 1);
return array (
0 => 'think\\admin\\Library',