|
|
@@ -7,7 +7,7 @@ use app\common\library\Token;
|
|
|
use app\common\model\LedgerWalletModel;
|
|
|
use app\common\model\UserModel;
|
|
|
use app\common\model\UserPathModel;
|
|
|
-use fast\Random;
|
|
|
+use fast\Asset;
|
|
|
use think\Config;
|
|
|
use think\Db;
|
|
|
use think\Exception;
|
|
|
@@ -43,6 +43,7 @@ class Member extends Api
|
|
|
if (empty($parent)) throw new Exception('邀请人不存在');
|
|
|
}
|
|
|
$user = $this->model->getByAddress($address);
|
|
|
+ $ledgerWalletModel = new LedgerWalletModel();
|
|
|
if (!empty($user)) { // 已存在
|
|
|
if ($user['parent_id'] == 0) {
|
|
|
// 绑定上级
|
|
|
@@ -51,7 +52,7 @@ class Member extends Api
|
|
|
// 创建网体
|
|
|
(new UserPathModel())->createPath($user['id'], $parentID);
|
|
|
//添加推荐人奖励
|
|
|
- $this->model::updateParentData($parentID, $user['id']);
|
|
|
+ $ledgerWalletModel->changeWalletAccount($parentID, Asset::TOKEN, getConfig('direct_income'), $ledgerWalletModel::Share, $user['id']);
|
|
|
}
|
|
|
}
|
|
|
} else { // 不存在
|
|
|
@@ -73,7 +74,7 @@ class Member extends Api
|
|
|
// 创建网体
|
|
|
(new UserPathModel())->createPath($newUserID, $parentID);
|
|
|
//推荐人奖励
|
|
|
- $this->model::updateParentData($parentID, $newUserID);
|
|
|
+ $ledgerWalletModel->changeWalletAccount($parentID, Asset::TOKEN, getConfig('direct_income'), $ledgerWalletModel::Share, $newUserID);
|
|
|
}
|
|
|
}
|
|
|
}
|