浏览代码

TeaC生态发展

afa 3 月之前
父节点
当前提交
a4d348e061

+ 14 - 1
application/api/controller/Chabao.php

@@ -14,7 +14,7 @@ use fast\Asset;
 use Exception;
 use app\common\model\UserModel;
 use think\Db;
-use app\api\validate\Chabao as ChabaoValidate;
+use app\common\model\LedgerTeacEcolyChangeModel;
 use app\common\library\Token;
 use think\Env;
 
@@ -132,6 +132,19 @@ class Chabao extends Api
         $this->success('ok');
     }
 
+    //转入TeaC生态发展
+    public function teacecology(UserModel $userModel, LedgerWalletModel $ledgerWalletModel)
+    {
+        $user = $userModel->getByPhone($this->params['mobile']);
+        
+        if(!$user) $this->error('钱包地址不存在');
+      
+        //添加Teac
+        $ledgerWalletModel->changeWalletAccount($user['id'], Asset::TEAC_ECOLY, $this->params['teacecology'], LedgerTeacEcolyChangeModel::TransferIn);
+        $this->success('ok');
+    }
+
+
 
    
 }

+ 37 - 0
application/common/model/LedgerTeacEcolyChangeModel.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace app\common\model;
+
+use think\Model;
+
+class LedgerTeacEcolyChangeModel extends Model
+{
+    // Teac-天使 TEAC_ECOLY
+    protected $name = "ledger_teac_ecoly_change";
+
+
+    //0 TeaC·生态发展转入
+    const TransferIn       = 0;
+    const Sell             = 1;
+    
+    /*
+     * 支付状态
+     * 0未支付 100支付中 200支付成功 400支付失败
+     */
+    public $pay_status = [
+        '-1'                   => '全部',
+        self::TransferIn       => 'TeaC·生态发展划转',
+       
+    
+    ];
+
+    //getStatusList
+    public static function getStatusList()
+    {
+        return [
+            self::TransferIn    => __('TeaC·生态发展划转'),
+
+         
+        ];
+    }
+}

+ 4 - 3
extend/fast/Asset.php

@@ -32,7 +32,7 @@ class Asset
     const TEAC = 'teac';
 
     /**
-     * 服务器算力
+     * teac天使
      * @var string
      */
     const TEAC_ANGEL = 'teac_angel';
@@ -44,10 +44,11 @@ class Asset
     const BUYING  = 'buying';
 
     /**
-     * SMH
+     * Teac生态发展
+
      * @var string
      */
-    const SMH = 'smh';
+    const TEAC_ECOLY = 'teac_ecology';
     /**
      * 标记金额
      * @var string