dever 6 years ago
parent
commit
9400a8d834
8 changed files with 48 additions and 10 deletions
  1. 27 0
      act/database/form_id.php
  2. 2 1
      act/lib/Form.php
  3. 2 2
      act/lib/Note.php
  4. 2 2
      act/lib/Share.php
  5. 2 2
      journal/lib/Pay.php
  6. 10 0
      main/src/Content.php
  7. 1 1
      main/src/Journal.php
  8. 2 2
      main/src/User.php

+ 27 - 0
act/database/form_id.php

@@ -5,6 +5,20 @@ $type = array
     1 => '普通表单',
     2 => '支付表单',
 );
+$cate = function() use ($auth)
+{
+    $array = array();
+    if ($auth) {
+        $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
+    } else {
+        $info = Dever::db('journal/cate')->state();
+    }
+    if($info)
+    {
+        $array += $info;
+    }
+    return $array;
+};
 $time = time()+(3600*24*7);
 return array
 (
@@ -38,6 +52,19 @@ return array
             'option'    => $type,
             'list'      => true,
         ),
+
+        'cate_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '小刊分类',
+            'default'   => '1',
+            'desc'      => '小刊分类',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $cate,
+            //'search'    => 'select',
+            'list'      => true,
+        ),
         
         'num'       => array
         (

+ 2 - 1
act/lib/Form.php

@@ -36,10 +36,11 @@ class Form
     }
 
     # 提交formid
-    public function submit($uid, $id, $type = 1)
+    public function submit($uid, $id, $type = 1, $system = 1)
     {
         $where['uid'] = $uid;
         $where['type'] = $type;
+        $where['cate_id'] = $system;
         $where['form_id'] = $id;
         $info = Dever::db('act/form_id')->one($where);
         if (!$info) {

+ 2 - 2
act/lib/Note.php

@@ -23,10 +23,10 @@ class Note
     }
 
     # 预约
-    public function submit($uid, $id, $type, $formid = '')
+    public function submit($uid, $id, $type, $formid = '', $system = 1)
     {
         if ($formid) {
-            Dever::load('act/lib/form')->submit($uid, $formid, 1);
+            Dever::load('act/lib/form')->submit($uid, $formid, 1, $system);
         }
         $where['uid'] = $uid;
         $where['data_id'] = $id;

+ 2 - 2
act/lib/Share.php

@@ -37,7 +37,7 @@ class Share
     }
 
     # 回流
-    public function submit_reflux($source_uid, $uid, $id, $type)
+    public function submit_reflux($source_uid, $uid, $id, $type, $system = 1)
     {
         if ($source_uid == $uid) {
             return false;
@@ -119,7 +119,7 @@ class Share
                                         # 发送模板消息 这里没有formid 暂时先不发送模板消息,后续应该通过前端收集formid就好了
 
                                         # 发短信
-                                        if (isset($user['mobile']) && $user['mobile'] && Dever::project('sms')) {
+                                        if (isset($user['mobile']) && $user['mobile'] && Dever::project('sms') && $system == 1) {
                                             $send = array();
                                             $send['num'] = $invite_num;
                                             $send['name'] = $journal['name'];

+ 2 - 2
journal/lib/Pay.php

@@ -74,7 +74,7 @@ class Pay
                 $user = Dever::db('passport/user')->one($uid);
 
                 # 发短信
-                if (isset($user['mobile']) && $user['mobile'] && Dever::project('sms')) {
+                if (isset($user['mobile']) && $user['mobile'] && Dever::project('sms') && $order['cate_id'] == 1) {
                     $send = array();
                     $send['name'] = $journal['name'];
                     Dever::load('sms/api.send', 'buy_journal', $user['mobile'], $send);
@@ -84,7 +84,7 @@ class Pay
                 $wechat = Dever::db('passport/wechat')->one(array('uid' => $uid));
                 if ($wechat && Dever::project('wechat_applet')) {
                     $send['key'] = 'buy_journal';
-                    $send['project_id'] = 1;
+                    $send['project_id'] = $order['cate_id'];
                     $send['touser'] = $wechat['openid'];
                     $send['page'] = Dever::config('base')->applet_index . '?scene=' . Dever::login($uid) . ',' . '4,' . $order['product_id'];
                     $send['data'] = array

+ 10 - 0
main/src/Content.php

@@ -56,6 +56,14 @@ class Content extends Core
             Dever::load('sms/api.send', 'buy_journal', $user['mobile'], $send);
         }
     }
+
+    # 开屏广告
+    public function ad()
+    {
+        $this->data['push_screen_ad'] = Dever::load('push/lib/data')->get('app_screen_ad', 'APP开屏广告', 1);
+
+        return $this->data;
+    }
     
     # 首页精选
     public function home()
@@ -88,6 +96,8 @@ class Content extends Core
             $this->data['push_open_ad'] = Dever::load('push/lib/data')->get('open_ad', '精选弹窗广告位');
         }
         
+        # 开屏广告
+        $this->data['push_screen_ad'] = Dever::load('push/lib/data')->get('app_screen_ad', 'APP开屏广告', 1);
 
         # 推荐位
         $this->data['push_link'] = Dever::load('push/lib/data')->get('link', '精选分类');

+ 1 - 1
main/src/Journal.php

@@ -675,7 +675,7 @@ class Journal extends Core
 
         if ($order_data['system'] == 1) {
             if (isset($this->data['pay']['prepay_id'])) {
-                Dever::load('act/lib/form')->submit($this->data['uid'], $this->data['pay']['prepay_id'], 2);
+                Dever::load('act/lib/form')->submit($this->data['uid'], $this->data['pay']['prepay_id'], 2, $this->data['system']);
             } else {
                 Dever::alert('支付失败');
             }

+ 2 - 2
main/src/User.php

@@ -187,7 +187,7 @@ class User extends Core
             Dever::alert('错误的类型');
         }
 
-        Dever::load('act/lib/share')->submit_reflux($source_uid, $this->data['uid'], $id, $type);
+        Dever::load('act/lib/share')->submit_reflux($source_uid, $this->data['uid'], $id, $type, $this->data['system']);
 
         return array('id' => $id, 'type' => $type);
     }
@@ -223,7 +223,7 @@ class User extends Core
             Dever::alert('错误的类型');
         }
 
-        Dever::load('act/lib/note')->submit($this->data['uid'], $id, $type, $formid);
+        Dever::load('act/lib/note')->submit($this->data['uid'], $id, $type, $formid, $this->data['system']);
 
         return array('id' => $id, 'type' => $type);
     }