dever 6 years ago
parent
commit
b48ed8d79d
7 changed files with 52 additions and 13 deletions
  1. 4 1
      act/lib/Invite.php
  2. 6 0
      doc/apidoc.php
  3. 21 4
      main/database/config.php
  4. 2 2
      main/lib/Core.php
  5. 4 2
      main/src/Journal.php
  6. 9 4
      main/src/User.php
  7. 6 0
      push/lib/Data.php

+ 4 - 1
act/lib/Invite.php

@@ -7,11 +7,14 @@ use Dever;
 class Invite
 {
     # 获取小刊的邀请排行
-    public function getList($uid, $id, $type = 4)
+    public function getList($uid, $id, $type = 4, $num = false)
     {
     	$where['source_uid'] = $uid;
         $where['type'] = $type;
         $where['data_id'] = $id;
+        if ($num > 0) {
+            $where['page'] = array(6, 'list');
+        }
         $data = Dever::db('act/invite')->getAll($where);
 
         if ($data) {

+ 6 - 0
doc/apidoc.php

@@ -274,6 +274,7 @@
  * @apiSuccess {String}   config.article_share_name 图文详情页分享文字
  * @apiSuccess {String}   config.vod_share_name 视频详情页分享文字
  * @apiSuccess {String}   config.live_share_name 直播详情页分享文字
+ * @apiSuccess {String}   config.ios_pay ios支付设置 1为不开启小程序支付,2为开启小程序支付,使用h5支付
 
  * @apiSuccess {Object[]} menu 栏目
  * @apiSuccess {String}   menu.name 名称
@@ -753,6 +754,11 @@
  * @apiSuccess {String}   active.invite_title 邀请好友标题
  * @apiSuccess {String}   active.invite_desc 邀请好友描述 换行用\n隔开
  * @apiSuccess {String}   active.content 活动说明,富文本
+
+  * @apiSuccess {Object[]}   invite 我的邀请
+ * @apiSuccess {String}   invite.uid 用户id
+ * @apiSuccess {String}   invite.username 用户名
+ * @apiSuccess {String}   invite.avatar 头像
  */
 
 /**

+ 21 - 4
main/database/config.php

@@ -1,10 +1,9 @@
 <?php
 
-$code = array
+$ios_pay = array
 (
-	1 => '用户ID',
-	2 => '随机数字',
-	3 => '随机数字+字母',
+	1 => '关闭小程序支付',
+	2 => '开启小程序支付-仅支持h5支付',
 );
 
 return array
@@ -103,6 +102,24 @@ return array
 			'update'	=> 'text',
 		),
 
+		'hr3'		=> array
+		(
+			'name' 		=> '支付设置',
+			'class'		=> '',//本项必须填写
+			'attr'		=> '',
+		),
+
+		'ios_pay'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ios支付设置',
+			'default' 	=> '1',
+			'desc' 		=> 'ios支付设置',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'radio',
+			'option'	=> $ios_pay,
+		),
+
 		'cdate'		=> array
 		(
 			'type' 		=> 'int-11',

+ 2 - 2
main/lib/Core.php

@@ -12,14 +12,14 @@ class Core
     {
         # 获取用户信息
         if ($this->checkUser) {
-            $this->data['uid'] = Dever::load('passport/applet')->check();
+            //$this->data['uid'] = Dever::load('passport/applet')->check();
         } else {
             $this->data['uid'] = Dever::load('passport/applet')->check(false);
         }
         if ($this->data['uid'] < 0) {
             $this->data['uid'] = 0;
         }
-        //$this->data['uid'] = 1;
+        $this->data['uid'] = 1;
 
         # 获取基本配置
         $this->data['config'] = Dever::db('main/config')->one();

+ 4 - 2
main/src/Journal.php

@@ -204,7 +204,9 @@ class Journal extends Core
         }
 
         # 获取我邀请的好友
-
+        if ($this->data['uid']) {
+            $this->data['invite'] = Dever::load('act/lib/invite')->getList($this->data['uid'], $id);
+        }
 
         return $this->data;
     }
@@ -228,7 +230,7 @@ class Journal extends Core
 
         $id = $this->check();
 
-        $this->data['invite'] = Dever::load('act/lib/invite')->getList($this->data['uid'], $id, 1);
+        $this->data['invite'] = Dever::load('act/lib/invite')->getList($this->data['uid'], $id);
 
         return $this->data;
     }

+ 9 - 4
main/src/User.php

@@ -125,19 +125,24 @@ class User extends Core
         $info = Dever::db($table)->one($id);
         $scene = Dever::login($this->data['uid']) . ',' . $type . ',' . $id;
 
+        //echo $scene;die;
         $send['project'] = Dever::input('project', 1);
         $send['send'] = $scene;
         $send['width'] = 152;
         $send['path'] = $path;
-        $logo = Dever::load('wechat_applet/code.get', $send);
+        //$logo = Dever::load('wechat_applet/code.get', $send);
 
         $model = array
         (
             'pic' => Dever::local($info['share_pic']),
-            'name' => $info['share_name'],
-            'logo' => Dever::local(str_replace('https', 'http', $logo)),
+            'name' => $info['share_title'],
+            //'logo' => Dever::local(str_replace('https', 'http', $logo)),
         );
-        $template = $info['share'];
+
+        if ($info['share']) {
+            $template = $info['share'];
+        }
+        
         $img = Dever::load('poster/api.get', $scene, $template, $model);
         return $img;
     }

+ 6 - 0
push/lib/Data.php

@@ -96,6 +96,12 @@ class Data
             unset($info['journal_id']);
         }
 
+        if ($info['link']) {
+            if (!strstr($info['link'], 'http')) {
+                $info['link'] = 'http://' . $info['link'];
+            }
+        }
+
         $info['cdate'] = date('Y-m-d', $info['cdate']);
 
         return $info;