|
|
@@ -4,8 +4,8 @@ namespace App\Module\Fund\Services;
|
|
|
|
|
|
|
|
|
use App\Module\Fund\CoreService;
|
|
|
-use App\Module\Fund\Enums\FundType;
|
|
|
-use App\Module\Fund\Enums\LogType;
|
|
|
+use App\Module\Fund\Enums\FUND_TYPE;
|
|
|
+use App\Module\Fund\Enums\LOG_TYPE;
|
|
|
use App\Module\Fund\Models\FundAdminModel;
|
|
|
use App\Module\Fund\Models\FundLogModel;
|
|
|
use App\Module\Fund\Models\FundModel;
|
|
|
@@ -44,7 +44,7 @@ class FundService extends CoreService
|
|
|
* @param int $amount
|
|
|
* @param string $remark
|
|
|
*/
|
|
|
- public function circulation(FundType $to_fund_id, int $amount, int $re_id, string $re_type, string $remark)
|
|
|
+ public function circulation(FUND_TYPE $to_fund_id, int $amount, int $re_id, string $re_type, string $remark)
|
|
|
{
|
|
|
# 确认货币种类一致
|
|
|
if (!CurrencyService::check($this->fundId, $to_fund_id->valueInt())) {
|
|
|
@@ -63,12 +63,12 @@ class FundService extends CoreService
|
|
|
}
|
|
|
# 进行双方的资金修改
|
|
|
# 先减少自己的
|
|
|
- $re46 = User::handle($this->userId, $this->fundId, -$amount, LogType::CIRCULATION, $re_id, $remark);
|
|
|
+ $re46 = User::handle($this->userId, $this->fundId, -$amount, LOG_TYPE::CIRCULATION, $re_id, $remark);
|
|
|
if (is_string($re46)) {
|
|
|
return $re46;
|
|
|
}
|
|
|
# 再增加自己另一个账户
|
|
|
- $re51 = User::handle($this->userId, $to_fund_id->valueInt(), $amount, LogType::CIRCULATION, $re_id, $remark);
|
|
|
+ $re51 = User::handle($this->userId, $to_fund_id->valueInt(), $amount, LOG_TYPE::CIRCULATION, $re_id, $remark);
|
|
|
|
|
|
|
|
|
if (is_string($re51)) {
|
|
|
@@ -111,7 +111,7 @@ class FundService extends CoreService
|
|
|
}
|
|
|
# 进行双方的资金修改
|
|
|
# 先减少自己的
|
|
|
- $re46 = User::handle($this->userId, $this->fundId, -$amount, LogType::TRANSFER, $transfer_id, $remark);
|
|
|
+ $re46 = User::handle($this->userId, $this->fundId, -$amount, LOG_TYPE::TRANSFER, $transfer_id, $remark);
|
|
|
if (is_string($re46)) {
|
|
|
|
|
|
DB::rollBack();
|
|
|
@@ -120,7 +120,7 @@ class FundService extends CoreService
|
|
|
return $re46;
|
|
|
}
|
|
|
# 再增加别人的
|
|
|
- $re51 = User::handle($toUserId, $this->fundId, $amount, LogType::TRANSFER, $transfer_id, $remark);
|
|
|
+ $re51 = User::handle($toUserId, $this->fundId, $amount, LOG_TYPE::TRANSFER, $transfer_id, $remark);
|
|
|
if (is_string($re51)) {
|
|
|
|
|
|
DB::rollBack();
|
|
|
@@ -150,7 +150,7 @@ class FundService extends CoreService
|
|
|
Helper::check_tr();
|
|
|
$transfer_id = $transfer_type.'-'.$transfer_id;
|
|
|
# 先减少自己的
|
|
|
- $re46 = User::handle($this->userId, $this->fundId, -$amount, LogType::TRADE, $transfer_id, $remark);
|
|
|
+ $re46 = User::handle($this->userId, $this->fundId, -$amount, LOG_TYPE::TRADE, $transfer_id, $remark);
|
|
|
|
|
|
if (is_string($re46)) {
|
|
|
\UCore\Trace::addData('error', $re46);
|
|
|
@@ -158,7 +158,7 @@ class FundService extends CoreService
|
|
|
return $re46;
|
|
|
}
|
|
|
# 再增加别人的
|
|
|
- $re51 = User::handle($toUserId, $this->fundId, $amount, LogType::TRANSFER, $transfer_id, $remark);
|
|
|
+ $re51 = User::handle($toUserId, $this->fundId, $amount, LOG_TYPE::TRANSFER, $transfer_id, $remark);
|
|
|
if (is_string($re51)) {
|
|
|
\UCore\Trace::addData('error', $re51);
|
|
|
|
|
|
@@ -173,12 +173,12 @@ class FundService extends CoreService
|
|
|
* Admin 资金操作
|
|
|
*
|
|
|
* @param int $admin_id
|
|
|
- * @param FundType $fund_id
|
|
|
+ * @param FUND_TYPE $fund_id
|
|
|
* @param int $fund_fee
|
|
|
* @param $remark
|
|
|
* @return bool|string
|
|
|
*/
|
|
|
- public function admin_operate(int $admin_id, FundType $fund_id, int $fund_fee, $remark)
|
|
|
+ public function admin_operate(int $admin_id, FUND_TYPE $fund_id, int $fund_fee, $remark)
|
|
|
{
|
|
|
|
|
|
$data = [
|
|
|
@@ -203,7 +203,7 @@ class FundService extends CoreService
|
|
|
}
|
|
|
# 进行资金操作
|
|
|
$re = \App\Module\Fund\Service\User::handle($this->userId, $fund_id->value, $fund_fee,
|
|
|
- \App\Module\Fund\Enums\LogType::ADMIN, $fund_admin->id, $remark);
|
|
|
+ \App\Module\Fund\Enums\LOG_TYPE::ADMIN, $fund_admin->id, $remark);
|
|
|
if (is_string($re)) {
|
|
|
DB::rollBack();
|
|
|
|