afa 4 сар өмнө
parent
commit
c559f1dfa6

+ 13 - 7
application/api/controller/Chabao.php

@@ -6,9 +6,8 @@ namespace app\api\controller;
 use app\api\logic\CommonLogic;
 use app\common\controller\Api;
 use app\api\logic\TeacLogin;
-use app\common\model\LedgerTeacChangeModel;
+use app\common\model\LedgerTeacAngelChangeModel;
 use app\common\model\LedgerTokenChangeModel;
-use app\common\model\UserTeac;
 use app\common\model\LedgerWalletModel;
 use think\Log;
 use fast\Asset;
@@ -74,7 +73,6 @@ class Chabao extends Api
                 'create_time'   => $time,
                 'team_level_id' => 0,
             ];
-         
             // 创建用户
             $newUserID = $userModel->insertGetId($data);
             // 创建钱包
@@ -109,9 +107,6 @@ class Chabao extends Api
     }
 
 
-
-
-
     //转让茶宝
     public function chalink(UserModel $userModel, LedgerWalletModel $ledgerWalletModel)
     {
@@ -124,7 +119,18 @@ class Chabao extends Api
         $this->success('ok');
     }
 
- 
+
+    //转入Teac
+    public function teac(UserModel $userModel, LedgerWalletModel $ledgerWalletModel)
+    {
+        $user = $userModel->getByPhone($this->params['mobile']);
+        
+        if(!$user) $this->error('钱包地址不存在');
+      
+        //添加Teac
+        $ledgerWalletModel->changeWalletAccount($user['id'], Asset::TEAC_ANGEL, $this->params['teac'], LedgerTeacAngelChangeModel::TransferIn);
+        $this->success('ok');
+    }
 
 
    

+ 8 - 29
application/common/model/LedgerTeacAngelChangeModel.php

@@ -10,49 +10,28 @@ class LedgerTeacAngelChangeModel extends Model
     protected $name = "ledger_teac_angel_change";
 
 
-    //0支付 1转让支付 2 转让收款 3 充值 4 提现 5扣除书续费
-    const Pledge           = 0;
+    //0茶付宝转入
+    const TransferIn       = 0;
     const Sell             = 1;
-    const SellBuy          = 2;
-    const Buying           = 3;
-    const BuySell          = 4;
-    const SellCancel       = 5;
-    const Exchange         = 6;
-    const PledgeFee        = 7; //存储服务费
-    const TeamLevel        = 8; //等级分佣
-    const System           = 100; //系统调整
+    
     /*
      * 支付状态
      * 0未支付 100支付中 200支付成功 400支付失败
      */
     public $pay_status = [
         '-1'                   => '全部',
-        self::Pledge           => '质押存储',
+        self::TransferIn       => '茶付宝转入',
         self::Sell             => 'C2C出售',
-        self::SellBuy          => 'C2C出售购买',
-        self::Buying           => 'C2C求购',
-        self::BuySell          => 'C2C求购出售',
-        self::SellCancel       => 'C2C取消出售',
-        self::Exchange         => 'Teac兑换',
-        self::PledgeFee        => '存储服务费',
-        self::TeamLevel        => '社区服务奖励',
-        self::System           => '系统调整',
+    
     ];
 
     //getStatusList
     public static function getStatusList()
     {
         return [
-            self::Pledge    => __('质押存储'),
-            self::Sell      => __('C2C出售'),
-            self::SellBuy   => __('C2C出售购买'),
-            self::Buying    => __('C2C存储'),
-            self::BuySell   => __('C2C存储出售'),
-            self::SellCancel   => __('C2C取消出售'),
-            self::Exchange     => __('C2C兑换产品'),
-            self::PledgeFee    => __('存储服务费'),
-            self::TeamLevel    => __('社区服务奖励'),
-            self::System       => __('系统调整'),
+            self::TransferIn    => __('茶付宝转入'),
+            self::Sell          => __('C2C出售'),
+         
         ];
     }
 }

+ 3 - 0
application/common/model/LedgerWalletModel.php

@@ -95,6 +95,9 @@ class LedgerWalletModel extends Model
                 //扣掉赠送手续费
                 $changeModel = new LedgerFrozenChangeModel();
                 break;
+            case Asset::TEAC_ANGEL:
+                $changeModel = new LedgerTeacAngelChangeModel();
+                break;
             default:
                 throw new Exception('币种错误:' . $asset);
         }

+ 1 - 1
extend/fast/Asset.php

@@ -35,7 +35,7 @@ class Asset
      * 服务器算力
      * @var string
      */
-    const RENTAL_POWER = 'rental_power';
+    const TEAC_ANGEL = 'teac_angel';
 
     /**
      * 求购锁定金额