dever 6 rokov pred
rodič
commit
926875bd4a
3 zmenil súbory, kde vykonal 31 pridanie a 14 odobranie
  1. 11 13
      combine/lib/Core.php
  2. 19 0
      doc/apidoc.php
  3. 1 1
      live/lib/Handle.php

+ 11 - 13
combine/lib/Core.php

@@ -29,12 +29,12 @@ class Core
             'code/info',
             'source/user',
             'score/action_log',
-            //'score/user',//积分
-            //'score/user_level',//等级
+            //'score/user',//积分相关的要加上,不能直接修改
+            //'score/user_level',//等级,不做合并,保留即可
             'score/user_log',//积分日志
             'message/inbox',
             'invite/relation',
-            'pay/order',
+            //'pay/order',//支付系统单独建立,如果通过接口会有安全问题,因为数据是独立的,暂时不做合并
             'journal/order',
         );
         if (is_string($drop)) {
@@ -46,7 +46,6 @@ class Core
             }
             foreach ($table as $k1 => $v1) {
                 Dever::db($v1)->updates(array('set_uid' => $uid, 'option_uid' => $v));
-                echo 22;die;
             }
 
             # 处理一些特殊的情况
@@ -69,15 +68,14 @@ class Core
         $db = Dever::db($table);
         $user_score = $db->one(array('uid' => $uid));
         $user_drop_score = $db->one(array('uid' => $drop_uid));
-        $score = $user_score[$col] + $user_drop_score[$col];
+        if ($user_score && $user_drop_score) {
+            $score = $user_score[$col] + $user_drop_score[$col];
 
-        $update['where_id'] = $user_score['id'];
-        $update['score'] = $score;
-        $db->update($update);
-
-        $update['where_id'] = $user_drop_score['id'];
-        $update['score'] = 0;
-        $update['state'] = 0;
-        $db->update($update);
+            $update['where_id'] = $user_score['id'];
+            $update['score'] = $score;
+            $db->update($update);
+            
+            $db->delete($user_drop_score['id']);
+        }
     }
 }

+ 19 - 0
doc/apidoc.php

@@ -202,6 +202,25 @@
  * @apiSuccess {String}   signature 用于登录后的uid验证,每次都要传入,请登录后将这个值保存在本地
  */
 
+/**
+ * @api {get} wonderful/oauth/?l=request.callback 第三方登录
+ * @apiVersion 1.0.0
+ * @apiName request.callback
+ * @apiGroup AppPassport
+ *
+ * @apiDescription 第三方登录
+ *
+ * @apiParam {Number} account 第三方登录的账号,写死为2
+ * @apiParam {Number} system 系统id,写死为1,后续做ok精彩和精品时再加
+ * @apiParam {String} source 渠道来源,写死为1,默认1则为官网渠道
+ * @apiParam {String} source_type 渠道类型,写死为ios或者android
+ *
+
+ * @apiSuccess {Number}   uid  用户id,请保存在本地
+ * @apiSuccess {Number}   mobile  手机号,判断手机号是否存在,不存在则需要进行绑定,请直接使用app.bind_mobile接口进行绑定即可
+ * @apiSuccess {String}   signature 用于登录后的uid验证,每次都要传入,请登录后将这个值保存在本地
+ */
+
 /**
  * @api {get} wonderful/passport/?l=app.update 更新用户信息
  * @apiVersion 1.0.0

+ 1 - 1
live/lib/Handle.php

@@ -114,7 +114,7 @@ class Handle
             try {
                 $url_m3u8 = $config['host'] . $method->save($info['key'],$data[$video['sdate']], $data[$video['edate']]);
                 $url_mp4 = '';
-                //$url_mp4 = $config['host'] . $method->save($info['key'], $data[$video['sdate']], $data[$video['edate']], 'mp4');
+                $url_mp4 = $config['host'] . $method->save($info['key'], $data[$video['sdate']], $data[$video['edate']], 'mp4');
             } catch (\Exception $e) {
                 $url_m3u8 = $url_mp4 = '';
             }