dever 6 years ago
parent
commit
d29c95712b
3 changed files with 148 additions and 0 deletions
  1. 132 0
      act/database/form_id.php
  2. 12 0
      act/lib/Share.php
  3. 4 0
      oauth/index.php

+ 132 - 0
act/database/form_id.php

@@ -0,0 +1,132 @@
+<?php
+
+$table = Dever::config('base')->type;
+$time = time()+(3600*24*7);
+return array
+(
+    # 表名
+    'name' => 'form_id',
+    # 显示给用户看的名称
+    'lang' => '模板form_id收集表',
+    'menu' => false,
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'list'      => true,
+        ),
+
+        'type'      => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '类别',
+            'default'   => '',
+            'desc'      => '类别',
+            'match'     => 'option',
+            'search'    => 'select',
+            'option'    => $table,
+            'list'      => true,
+        ),
+        
+        'data_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '标题',
+            'default'   => '',
+            'desc'      => '标题',
+            'match'     => 'option',
+            'list'      => 'Dever::load("act/lib/manage.load", "{type}", {data_id})',
+        ),
+
+        'uid'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '用户id',
+            'default'   => '',
+            'desc'      => '用户id',
+            'match'     => 'is_numeric',
+            'list'      => true,
+        ),
+        
+        'form_id'       => array
+        (
+            'type'      => 'varchar-700',
+            'name'      => 'form_id',
+            'default'   => '',
+            'desc'      => 'form_id',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+        
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '更新时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            'default'   => '',
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'top' => Dever::config('base', 'applet')->top,
+
+    'manage' => array
+    (
+        //'delete' => false,
+        'insert' => false,
+        'edit' => false,
+    ),
+
+    'request' => array
+    (
+        'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'product_id' => 'yes',
+                'uid' => 'yes',
+                'cdate' => array($time, '<='),
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('cdate' => 'desc'),
+            'limit' => '0,100',
+            'col' => '*',
+        ),
+
+        'getAllGroupByUid' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'product_id' => 'yes',
+                'cdate' => array($time, '<='),
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'group' => 'uid',
+            'order' => array('cdate' => 'desc'),
+            'col' => '*',
+        ),
+    ),
+);

+ 12 - 0
act/lib/Share.php

@@ -108,6 +108,18 @@ class Share
                                 $invite_num = Dever::load('act/lib/invite')->getTotal($source_uid, $id, $type);
 
                                 if ($invite_num >= $num) {
+
+                                    # 发消息
+                                    if ($invite_num == $num) {
+                                        $journal = Dever::db('journal/info')->one($id);
+                                        Dever::load('message/lib/data')->push(-1, $source_uid, '活动提醒', '邀请人数已达'.$invite_num.'人,您获得了 '.$journal['name'].' 的阅读资格!', 1);
+
+                                        # 发送模板消息
+
+                                        # 发短信
+                                        
+                                    }
+                                    
                                     Dever::load('act/lib/subscribe')->submit($source_uid, $id, 3);
                                 }
                             }

+ 4 - 0
oauth/index.php

@@ -0,0 +1,4 @@
+<?php
+define('DEVER_PACKAGE',  'oauth');
+define('DEVER_APP_SETUP', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+include(dirname(__FILE__) . DIRECTORY_SEPARATOR . '../boot.php');