lizhen_gitee 1 rok temu
rodzic
commit
8df134b527
1 zmienionych plików z 19 dodań i 13 usunięć
  1. 19 13
      application/api/controller/Demo.php

+ 19 - 13
application/api/controller/Demo.php

@@ -3,8 +3,7 @@
 namespace app\api\controller;
 
 use app\common\controller\Api;
-use app\common\library\Transaction;
-use app\common\library\Easemob;
+use think\Db;
 /**
  * 示例接口
  */
@@ -41,17 +40,24 @@ class Demo extends Api
      */
     public function test()
     {
-
-        $easemob = new Easemob();
-
-        //推送给某一个人
-        //$easemob->push_text(1009,'测试标题','测试内容');
-
-        //全量推送
-        //$easemob->push_all('全量标题','全量内容');
-
-        //header
-        //Authorization:Bearer ${YourAppToken}
+        exit;
+
+        $user_id = 1;
+        $accountType = 'gold';
+        $number = -3.1;
+        $logtype = 1;
+        $remark = 'bz';
+        $table = 'demo';
+        $table_id = 1;
+
+        Db::startTrans();
+        $rs_wallet = model('wallet')->lockChangeAccountRemain($user_id,$accountType,$number,$logtype,$remark,$table,$table_id);
+        if($rs_wallet['status'] === false){
+            Db::rollback();
+            $this->error($rs_wallet['msg']);
+        }
+        Db::commit();
+        $this->success();
     }
 
     /**