rabin 1 year ago
parent
commit
929e435735
46 changed files with 1283 additions and 0 deletions
  1. 2 0
      app/boot.php
  2. 6 0
      app/content/assets/manage/html/baoming.html
  3. 260 0
      app/content/database/baoming.php
  4. 121 0
      app/content/database/pic.php
  5. 107 0
      app/content/database/up.php
  6. 8 0
      app/content/index.php
  7. 10 0
      app/content/lib/Baoming.php
  8. 92 0
      app/content/lib/Manage.php
  9. 5 0
      app/content/template/manage/baoming.php
  10. 247 0
      app/setting/database/info.php
  11. 151 0
      app/setting/database/source.php
  12. 8 0
      app/setting/index.php
  13. 16 0
      app/setting/lib/Code.php
  14. 19 0
      app/setting/lib/Manage.php
  15. 9 0
      boot.php
  16. 5 0
      common.php
  17. 3 0
      package.json
  18. 7 0
      package/area/daemon/import.php
  19. 4 0
      package/area/index.php
  20. 2 0
      package/boot.php
  21. 4 0
      package/email/index.php
  22. 4 0
      package/excel/index.php
  23. 4 0
      package/invite/index.php
  24. 88 0
      package/manage/config/base.php
  25. 11 0
      package/manage/config/plugin.php
  26. 7 0
      package/manage/daemon/loop.php
  27. 7 0
      package/manage/daemon/main.php
  28. 4 0
      package/manage/index.php
  29. 4 0
      package/message/index.php
  30. 4 0
      package/oauth/index.php
  31. 4 0
      package/passport/index.php
  32. 4 0
      package/pay/index.php
  33. 4 0
      package/pdf/index.php
  34. 4 0
      package/pinyin/index.php
  35. 4 0
      package/poster/index.php
  36. 4 0
      package/push/index.php
  37. 4 0
      package/qrcode/index.php
  38. 4 0
      package/queue/index.php
  39. 4 0
      package/score/index.php
  40. 4 0
      package/share/index.php
  41. 4 0
      package/short/index.php
  42. 4 0
      package/sms/index.php
  43. 4 0
      package/token/index.php
  44. 4 0
      package/upload/index.php
  45. 4 0
      package/wechat_applet/index.php
  46. 4 0
      package/wechat_service/index.php

+ 2 - 0
app/boot.php

@@ -0,0 +1,2 @@
+<?php
+include(dirname(__FILE__) . DIRECTORY_SEPARATOR . '../boot.php');

+ 6 - 0
app/content/assets/manage/html/baoming.html

@@ -0,0 +1,6 @@
+
+<form class="layui-form form10" action="" target="f10" method="post">
+<iframe id="f10" name="f10" style="display:none;"></iframe>
+<div class="layui-form-item" id="show">
+</div>
+</form>

+ 260 - 0
app/content/database/baoming.php

@@ -0,0 +1,260 @@
+<?php
+
+$status = array
+(
+    1 => array('name' => '待审核', 'style' => 'font-weight:bold;color:#436EEE'),
+    2 => array('name' => '入选审核通过', 'style' => 'font-weight:bold;color:#003366'),
+    3 => array('name' => '未通过入选', 'style' => 'font-weight:bold;color:#993333'),
+);
+
+$audit = array
+(
+    //1 => '待审核',
+    2 => '审核通过',
+    3 => '审核未通过',
+);
+
+$sex = array
+(
+    1 => '男',
+    2 => '女',
+);
+
+return array
+(
+    # 表名
+    'name' => 'baoming',
+    # 显示给用户看的名称
+    'lang' => '报名列表',
+    'order' => 100,
+    'set' => array
+    (
+        'status' => $status,
+        'audit' => $audit,
+    ),
+
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'list'      => true,
+        ),
+
+        'act_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '活动id',
+            'default'   => 'act_id',
+            'desc'      => '活动id',
+            'match'     => 'is_numeric',
+        ),
+
+        'parent_name'      => array
+        (
+            'type'      => 'varchar-300',
+            'name'      => '家长姓名',
+            'default'   => '',
+            'desc'      => '家长姓名',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'list'      => true,
+            'search'    => 'fulltext',
+        ),
+
+        'mobile'      => array
+        (
+            'type'      => 'bigint-11',
+            'name'      => '联系电话',
+            'default'   => '',
+            'desc'      => '联系电话',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'list'      => true,
+            'search'    => 'fulltext',
+        ),
+
+        'area'      => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '所在城市',
+            'default'   => '',
+            'desc'      => '所在城市',
+            'match'     => 'is_string',
+            'search'    => 'linkage',
+            'update'    => 'linkage',
+            'option'    => Dever::url('api.get?level_total=2', 'area'),
+            'list'      => 'Dever::load("area/api.string", "{area}")',
+        ),
+
+        'name'      => array
+        (
+            'type'      => 'varchar-300',
+            'name'      => '宝贝姓名',
+            'default'   => '',
+            'desc'      => '宝贝姓名',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'list'      => true,
+            'search'    => 'fulltext',
+        ),
+
+        'age'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '宝贝年龄',
+            'default'   => '',
+            'desc'      => '宝贝年龄',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
+        'sex'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '宝贝性别',
+            'default'   => '',
+            'desc'      => '宝贝性别',
+            'match'     => 'option',
+            'update'    => 'radio',
+            'option'    => $sex,
+        ),
+
+        'height'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '宝贝身高',
+            'default'   => '',
+            'desc'      => '宝贝身高',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
+        'weight'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '宝贝体重',
+            'default'   => '',
+            'desc'      => '宝贝体重',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
+        'size'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '宝贝衣服尺码',
+            'default'   => '',
+            'desc'      => '宝贝衣服尺码',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
+        'audit'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '审核状态',
+            'default'   => '2',
+            'desc'      => '审核状态',
+            'match'     => 'is_numeric',
+            'option'    => $audit,
+            'update'    => $col ? 'radio' : false,
+        ),
+
+        'audit_desc'        => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '审核备注',
+            'default'   => '',
+            'desc'      => '审核备注',
+            'match'     => 'option',
+            'update'    => $col ? 'textarea' : false,
+        ),
+
+        'audit_admin'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '审核人',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'desc'      => '审核人',
+            //'list'      => '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
+        ),
+
+        'status'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '状态',
+            'match'     => 'is_numeric',
+            'option'    => $status,
+            'search'    => 'select',
+            'list'      => true,
+            //'search_after' => '<br />',
+            //'mul'   => true,
+            //'mul_option' => array(2 => '批量审核'),
+        ),
+
+        'reorder'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '排序-数值越大越靠前,相当于置顶',
+            'default'   => '1',
+            'desc'      => '请输入排序',
+            'match'     => 'option',
+            //'update'  => 'text',
+            'search'    => 'order',
+            'list'      => true,
+            'order'     => 'desc',
+            'edit'      => 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'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+        ),
+    ),
+    
+    # 管理功能
+    'manage' => array
+    (
+        //'insert' => false,
+        # 列表
+        'list_button' => array
+        (
+            //'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=1'))),
+        ),
+    ),
+
+    # request 请求接口定义
+    'request' => array
+    (
+        'list_button' => array
+        (
+            'list' => array('查看详情', '"up&page_type=1&baoming_id={id}"'),
+
+            'fast' => array('审核', '"baoming&where_id={id}&col=audit,audit_desc"', '{status} == 1'),
+            'fast1' => array('反审核', '"baoming&where_id={id}&col=audit,audit_desc"', '{status} == 3'),
+        ),
+    ),
+);

+ 121 - 0
app/content/database/pic.php

@@ -0,0 +1,121 @@
+<?php
+
+$type = array
+(
+    1 => '现场直击',
+    2 => '超模风采',
+);
+
+return array
+(
+    # 表名
+    'name' => 'pic',
+    # 显示给用户看的名称
+    'lang' => '活动图片',
+    'order' => 80,
+
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'list'      => true,
+        ),
+
+        'act_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '活动id',
+            'default'   => '',
+            'desc'      => '活动id',
+            'match'     => 'is_numeric',
+        ),
+
+        'type'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '类型',
+            'default'   => '1',
+            'desc'      => '类型',
+            'match'     => 'is_numeric',
+            'option'    => $type,
+            'update'    => 'radio',
+            'search'	=> 'select',
+            'list'      => true,
+            'edit'      => true,
+        ),
+
+        'pic'     => array
+        (
+            'type'      => 'varchar-255',
+            'name'      => '图片-图片比例要求宽度不超过960px,高度不超过1200px',
+            'default'   => '',
+            'desc'      => '图片',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '1',
+            'list'		=> 'Dever::load("content/lib/manage.showPic", {id})',
+        ),
+
+        'reorder'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '排序-数值越大越靠前,相当于置顶',
+            'default'   => '1',
+            'desc'      => '请输入排序',
+            'match'     => 'option',
+            //'update'  => 'text',
+            'search'    => 'order',
+            'list'      => true,
+            'order'     => 'desc',
+            'edit'      => 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'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+        ),
+    ),
+    
+    # 管理功能
+    'manage' => array
+    (
+        'insert' => false,
+        'edit' => false,
+
+        # 自定义快捷新增和编辑
+        'button' => array
+        (
+            '新增' => array('fast'),
+        ),
+		'list_button' => array
+        (
+        	'edit' => array('编辑'),
+        )
+    ),
+
+    # request 请求接口定义
+    'request' => array
+    (
+        
+    ),
+);

+ 107 - 0
app/content/database/up.php

@@ -0,0 +1,107 @@
+<?php
+
+$type = array
+(
+    1 => '现场直击',
+    2 => '超模风采',
+);
+
+return array
+(
+    # 表名
+    'name' => 'up',
+    # 显示给用户看的名称
+    'lang' => '上传活动图片',
+    'order' => 80,
+    'set' => array
+    (
+        'type' => $type,
+    ),
+    'menu'	=> false,
+    'end' => array
+    (
+    	'insert' => 'content/lib/manage.upPic',
+        'update' => 'content/lib/manage.upPic',
+    ),
+
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'list'      => true,
+        ),
+
+        'act_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '活动id',
+            'default'   => '1',
+            'desc'      => '活动id',
+            'match'     => 'is_numeric',
+            'value'		=> '1',
+            'update'	=> 'hidden',
+        ),
+
+        'type'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '类型',
+            'default'   => '1',
+            'desc'      => '类型',
+            'match'     => 'is_numeric',
+            'option'    => $type,
+            'update'    => 'radio',
+            'search'	=> 'select',
+            'list'      => true,
+            'edit'      => true,
+        ),
+
+        'pic'     => array
+        (
+            'type'      => 'text-255',
+            'name'      => '图片-可以上传多张图片,图片比例要求宽度不超过960px,高度不超过1200px',
+            'default'   => '',
+            'desc'      => '图片',
+            'match'     => 'option',
+            'update'    => 'images',
+            'key'       => '1',
+        ),
+        
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '录入时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+        ),
+    ),
+    
+    # 管理功能
+    'manage' => array
+    (
+        'page_list' => 'baoming',
+    ),
+
+    # request 请求接口定义
+    'request' => array
+    (
+        
+    ),
+);

+ 8 - 0
app/content/index.php

@@ -0,0 +1,8 @@
+<?php
+
+define('DEVER_APP_NAME', 'content');
+define('DEVER_APP_LANG', '报名与内容管理');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+define('DEVER_MANAGE_ORDER', 200);
+define('DEVER_MANAGE_ICON', 'glyphicon glyphicon-tower layui-icon-tabs');
+include(DEVER_APP_PATH . '../boot.php');

+ 10 - 0
app/content/lib/Baoming.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace Content\Lib;
+
+use Dever;
+
+class Baoming
+{
+    
+}

+ 92 - 0
app/content/lib/Manage.php

@@ -0,0 +1,92 @@
+<?php
+
+namespace Content\Lib;
+
+use Dever;
+
+class Manage
+{
+    public function showPic($id)
+    {
+    	$info = Dever::db('content/pic')->find($id);
+
+    	if ($info && $info['pic']) {
+    		$table[] = '<img src="'.$info['pic'].'" width="150" />';
+    		return Dever::table($table);
+    	}
+
+    	return '';
+    }
+
+    public function upPic($id, $name, $data)
+    {
+    	$type = Dever::param('type', $data);
+    	$act_id = Dever::param('act_id', $data);
+    	$pic = Dever::param('pic', $data);
+    	if ($pic) {
+    		if (is_string($pic)) {
+    			$pic = explode(',', $pic);
+    		}
+    		$insert['type'] = $type;
+    		$insert['act_id'] = $act_id;
+    		foreach($pic as $k => $v) {
+    			$insert['pic'] = $v;
+    			Dever::load('content/pic')->insert($insert);
+    		}
+    	}
+    }
+
+    public function baoming()
+    {
+        $id = Dever::input('baoming_id');
+        $order_db = Dever::db('content/baoming');
+        $order = $order_db->one($id);
+        $order['config'] = $order_db->config['set'];
+        $content = array();
+        $content[0][] = array('当前状态', Dever::status($order['config']['status'], $order['status']));
+        $content[0][] = array('报名时间', date('Y-m-d H:i', $order['cdate']));
+
+        if (isset($order['audit_admin']) && $order['audit_admin']) {
+            $admin = Dever::db('manage/admin')->find($order['audit_admin']);
+            $content[1][] = array
+            (
+                array('审核人', $admin['username']),
+                array('审核状态', Dever::status($order['config']['audit'], $order['audit'])),
+                array('审核备注', $order['audit_desc']),
+            );
+        }
+
+        $result = array();
+        $result['基本信息'] = array
+        (
+            'type' => 'info',
+            'content' => $content,
+        );
+
+        $head = array
+        (
+            'name' => '基本信息',
+            'btn' => $this->show_button($order, $order_table),
+        );
+        $html = Dever::show($head, $result);
+        return $html;
+    }
+
+    # 显示按钮
+    private function show_button($order, $order_table)
+    {
+        $button = array();
+        if ($order['status'] == 1) {
+            list($project, $table) = explode('/', $order_table);
+            $url = Dever::url('project/database/update?project='.$project.'&table='.$table.'&where_id='.$order['id'].'&col=audit,audit_desc', 'manage');
+
+            $button[] = array
+            (
+                'type' => 'edit',
+                'link' => $url,
+                'name' => '审核',
+            );
+        }
+        return $button;
+    }
+}

+ 5 - 0
app/content/template/manage/baoming.php

@@ -0,0 +1,5 @@
+<?php
+
+$view
+->fetch('#show', 'content/lib/manage.baoming')
+->display();

+ 247 - 0
app/setting/database/info.php

@@ -0,0 +1,247 @@
+<?php
+$status = array
+(
+	1 => '未开始',
+	2 => '报名中',
+    3 => '名单公示',
+    4 => '大赛回顾',
+);
+
+return array
+(
+    # 表名
+    'name' => 'info',
+    # 显示给用户看的名称
+    'lang' => '活动配置',
+    # 后台菜单排序
+    'order' => -10,
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'list'      => true,
+            'order'     => 'asc',
+        ),
+        
+        'name'      => array
+        (
+            'type'      => 'varchar-200',
+            'name'      => '活动名称',
+            'default'   => '',
+            'desc'      => '活动名称',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'video'     => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '封面视频-可以为空,视频格式mp4,上传大小不能超过4G,比例要求宽度不超过960px,高度不超过1200px',
+            'default'   => '',
+            'desc'      => '封面视频',
+            'match'     => 'option',
+            'update'    => 'video',
+            'key'       => '3',
+        ),
+
+        'pic'     => array
+        (
+            'type'      => 'text-255',
+            'name'      => '封面图-图片比例要求宽度不超过960px,高度不超过1200px',
+            'default'   => '',
+            'desc'      => '封面图',
+            'match'     => 'option',
+            'update'    => 'images',
+            'key'       => '1',
+        ),
+
+        'desc'      => array
+        (
+            'type'      => 'text-255',
+            'name'      => '活动介绍',
+            'default'   => '',
+            'desc'      => '活动介绍',
+            'match'     => 'option',
+            'update'    => 'editor',
+            'key'       => 1,
+            //'list'      => true,
+        ),
+
+        'content'      => array
+        (
+            'type'      => 'text-255',
+            'name'      => '活动内容',
+            'default'   => '',
+            'desc'      => '活动内容',
+            'match'     => 'option',
+            'update'    => 'editor',
+            'key'       => 1,
+            //'list'      => true,
+        ),
+
+        'canyu'      => array
+        (
+            'type'      => 'text-255',
+            'name'      => '参与方式',
+            'default'   => '',
+            'desc'      => '参与方式',
+            'match'     => 'option',
+            'update'    => 'editor',
+            'key'       => 1,
+            //'list'      => true,
+        ),
+
+        'baoming_start'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '报名开始时间',
+            'default'   => '',
+            'desc'      => '报名开始时间',
+            'match'     => 'option',
+            'update'    => 'time',
+            'callback'  => 'maketime',
+            'tab'       => 1,
+        ),
+
+        'baoming_end'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '报名结束时间',
+            'default'   => '',
+            'desc'      => '报名结束时间',
+            'match'     => 'option',
+            'update'    => 'time',
+            'callback'  => 'maketime',
+            'tab'       => 1,
+        ),
+
+        'baoming_txt_top'      => array
+        (
+            'type'      => 'varchar-2000',
+            'name'      => '报名时顶部说明',
+            'default'   => '',
+            'desc'      => '报名时顶部说明',
+            'match'     => 'option',
+            'update'    => 'textarea',
+            'tab'       => 1,
+        ),
+
+        'baoming_txt_xieyi'      => array
+        (
+            'type'      => 'varchar-2000',
+            'name'      => '报名时底部协议',
+            'default'   => '',
+            'desc'      => '报名时底部协议',
+            'match'     => 'option',
+            'update'    => 'textarea',
+            'tab'       => 1,
+        ),
+
+        'baoming_txt_end'      => array
+        (
+            'type'      => 'varchar-2000',
+            'name'      => '报名结束介绍',
+            'default'   => '',
+            'desc'      => '报名结束介绍',
+            'match'     => 'option',
+            'update'    => 'textarea',
+            'tab'       => 1,
+        ),
+
+        'huigu_txt'      => array
+        (
+            'type'      => 'text-255',
+            'name'      => '回顾介绍',
+            'default'   => '',
+            'desc'      => '回顾介绍',
+            'match'     => 'option',
+            'update'    => 'editor',
+            'key'       => 1,
+            'tab'       => 2,
+        ),
+
+        'huigu_video_name'        => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '回顾视频标题',
+            'default'   => '',
+            'desc'      => '回顾视频标题',
+            'match'     => 'is_string',
+            'update'    => 'text',
+        ),
+
+        'huigu_video'     => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '回顾视频-视频格式mp4,上传大小不能超过4G,比例要求宽度不超过960px,高度不超过1200px',
+            'default'   => '',
+            'desc'      => '回顾视频',
+            'match'     => 'is_string',
+            'update'    => 'video',
+            'key'       => '3',
+        ),
+
+        'status'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '状态',
+            'match'     => 'is_numeric',
+            'option'    => $status,
+            'update'    => 'radio',
+            'list'      => true,
+            'edit'      => 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'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'default' => array
+	(
+		'col' => 'id,name,state,cdate',
+		'value' => array
+		(
+			'1,"默认活动", 1,' . DEVER_TIME,
+		),
+	),
+
+    'manage' => array
+    (
+        'tab' => array('基础信息', '报名设置', '活动回顾'),
+    	'delete' => false,
+        'list' => 'update',
+    ),
+
+    'request' => array
+    (
+        
+    ),
+);

+ 151 - 0
app/setting/database/source.php

@@ -0,0 +1,151 @@
+<?php
+
+return array
+(
+	# 表名
+	'name' => 'source',
+	# 显示给用户看的名称
+	'lang' => '合作来源',
+	# 后台菜单排序
+	'order' => -100,
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+			'search'	=> 'order',
+			'list'		=> true,
+			'order'		=> 'desc',
+		),
+		
+		'name'		=> array
+		(
+			'type' 		=> 'varchar-32',
+			'name' 		=> '来源名称',
+			'default' 	=> '',
+			'desc' 		=> '来源名称',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+			'search'	=> 'fulltext',
+			'list'		=> true,
+		),
+
+		'info'		=> array
+		(
+			'type' 		=> 'varchar-2000',
+			'name' 		=> '来源介绍',
+			'default' 	=> '',
+			'desc' 		=> '来源介绍',
+			'match' 	=> 'is_string',
+			'update'	=> 'textarea',
+			'list_name' => '来源信息',
+            'list'      => 'Dever::load("setting/lib/manage.showSource", {id})',
+            'list_header'  => array('width' => '60%'),
+		),
+
+		'num_view'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '访问量',
+			'default' 	=> '',
+			'desc' 		=> '访问量',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'text',
+			'list'		=> true,
+		),
+
+		'baoming_view'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '报名量',
+			'default' 	=> '',
+			'desc' 		=> '报名量',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'text',
+			'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' 		=> '',
+			# 只有insert时才生效
+			'insert'	=> true,
+			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
+		),
+	),
+
+	# 默认值
+	'default' => array
+	(
+		'col' => 'name,state,cdate',
+		'value' => array
+		(
+			'"默认来源",1,' . time(),
+		),
+	),
+
+	'manage' => array
+	(
+		'insert' => false,
+		'edit' => false,
+
+		# 自定义快捷新增和编辑
+		'button' => array
+		(
+			'新增' => array('fast'),
+		),
+		# 快捷更新
+		'list_button' => array
+		(
+			'edit' => array('编辑'),
+		),
+	),
+
+	'request' => array
+	(
+		# 增加访问量
+        'incView' => array
+        (
+            'type' => 'update',
+            'where' => array
+            (
+                'id' => 'yes',
+            ),
+            'set' => array
+            (
+                'num_view' => array('yes', '+='),
+            ),
+        ),
+
+        # 增加访问量
+        'incBaoming' => array
+        (
+            'type' => 'update',
+            'where' => array
+            (
+                'id' => 'yes',
+            ),
+            'set' => array
+            (
+                'baoming_view' => array('yes', '+='),
+            ),
+        ),
+	),
+);

+ 8 - 0
app/setting/index.php

@@ -0,0 +1,8 @@
+<?php
+
+define('DEVER_APP_NAME', 'setting');
+define('DEVER_APP_LANG', '基础配置');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+define('DEVER_MANAGE_ORDER', 10);
+define('DEVER_MANAGE_ICON', 'glyphicon glyphicon-tower layui-icon-component');
+include(DEVER_APP_PATH . '../boot.php');

+ 16 - 0
app/setting/lib/Code.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Setting\Lib;
+
+use Dever;
+
+class Code
+{
+    public function show_api()
+    {
+        $url = urldecode(Dever::input('url'));
+        $code = Dever::load('qrcode/api')->qrcode($url);
+
+        return $code;
+    }
+}

+ 19 - 0
app/setting/lib/Manage.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace Setting\Lib;
+
+use Dever;
+
+class Manage
+{
+    public function showSource($id)
+    {
+        $url = 'pages/dailishang/apply/apply/';
+        $url .= '?source_id=' . $id;
+
+        $code = Dever::url('setting/lib/code.show?url=' . urlencode($url));
+        $table['二维码'] = '<img src="'.$code.'" width="150"/>';
+        $table['来源链接'] = $url;
+        return Dever::table($table);
+    }
+}

+ 9 - 0
boot.php

@@ -0,0 +1,9 @@
+<?php
+$_SERVER['DEVER_SERVER'] = 'localhost';
+define('DEVER_PROJECT', 'act');
+define('DEVER_PROJECT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+if (defined('DEVER_PACKAGE')) {
+	include('lib/dever_package/'.DEVER_PACKAGE.'/index.php');
+} else {
+	include('lib/dever/boot.php');
+}

+ 5 - 0
common.php

@@ -0,0 +1,5 @@
+<?php
+$page = Dever::input('page');
+if ($page) {
+    Dever::setInput('pg', $page);
+}

+ 3 - 0
package.json

@@ -0,0 +1,3 @@
+{
+	"rely": "manage,passport,email"
+}

+ 7 - 0
package/area/daemon/import.php

@@ -0,0 +1,7 @@
+<?php
+
+define('DEVER_DAEMON', true);
+
+include(dirname(__FILE__) . DIRECTORY_SEPARATOR . '../index.php');
+
+Dever::load('area/import.load');

+ 4 - 0
package/area/index.php

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

+ 2 - 0
package/boot.php

@@ -0,0 +1,2 @@
+<?php
+include(dirname(__FILE__) . DIRECTORY_SEPARATOR . '../boot.php');

+ 4 - 0
package/email/index.php

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

+ 4 - 0
package/excel/index.php

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

+ 4 - 0
package/invite/index.php

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

+ 88 - 0
package/manage/config/base.php

@@ -0,0 +1,88 @@
+<?php
+
+$url = function()
+{
+	$url = Dever::input('loading') ? 'loading=1' : '';
+	$url .= Dever::input('ms') ? '&ms=' . Dever::input('ms') : '';
+
+	return $url;
+};
+
+# 一些基本配置
+$config['base'] = array
+(
+	'url' => $url(),
+
+	# 针对管理系统的配置,开启这个则每次刷新都读取admin的最新数据,测试功能
+	'getAdmin' => true,
+
+	# 开启批量更新
+	'mul_type' => 1,
+
+	# 地图配置
+	'map' => array
+	(
+		'url' => 'https://webapi.amap.com/maps?v=1.4.8&key=b51a0d5f8f977726eeaa070a30bcf3cd',
+	),
+
+	# 后台管理的数据执行权限的设置
+	//'manageAuthData' => 'journal/lib/manage.getManageData',
+
+	# 后台左侧主菜单,定义了这个之后,所有deverapp中的project建立主菜单功能将失效
+	/*
+	'menu' => array
+	(
+		'demand' => array
+		(
+			# 菜单名称
+			'name' => '需求管理',
+			# 哪些项目包含进来,多个用逗号隔开,直接把该项目中的database放到该菜单下
+			'project' => 'demand,service',
+			# 菜单图标 直接使用哪个project的图标
+			'icon' => 'demand',
+			# 排序
+			'order' => 100,
+		),
+
+		'main' => array
+		(
+			# 菜单名称
+			'name' => '系统设置',
+			# 哪些项目包含进来,多个用逗号隔开,直接把该项目中的database放到该菜单下
+			'project' => 'main,score,attr,category',
+			# 菜单图标 直接使用哪个project的图标
+			'icon' => 'main',
+			# 排序
+			'order' => 99,
+		),
+	)
+	*/
+);
+
+# 模板配置
+$config['template'] = array
+(
+	# 使用的模板 注意:定义这个之后,将会强制将本项目模板变成这个
+	'assets' => 'layadmin',
+	'template' => 'layadmin',
+
+	'replace' => array
+	(
+		'css' => '../css/',
+		'lib' => '../lib/',
+		'img' => '../img/',
+		'images' => '../images/',
+		'js' => '../js/',
+		'script' => '../script/',
+
+		# 以下的替换主要用于合并操作(host里的merge项)
+		'font' => '../fonts/',
+	),
+
+	'path' => 'html',
+	'layout' => '',
+
+	'relation' => array(),
+);
+
+return $config;

+ 11 - 0
package/manage/config/plugin.php

@@ -0,0 +1,11 @@
+<?php
+# 注册插件
+
+$config['manage/console.data'] = array
+(
+	# 直接覆盖旧的接口数据
+	'cover' => 'console.data',
+);
+
+
+return $config;

+ 7 - 0
package/manage/daemon/loop.php

@@ -0,0 +1,7 @@
+<?php
+
+define('DEVER_DAEMON', true);
+
+include(dirname(__FILE__) . DIRECTORY_SEPARATOR . '../index.php');
+
+Dever::load('manage/project.loop');

+ 7 - 0
package/manage/daemon/main.php

@@ -0,0 +1,7 @@
+<?php
+
+define('DEVER_DAEMON', true);
+
+include(dirname(__FILE__) . DIRECTORY_SEPARATOR . '../index.php');
+
+Dever::load('manage/project.cron');

+ 4 - 0
package/manage/index.php

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

+ 4 - 0
package/message/index.php

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

+ 4 - 0
package/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');

+ 4 - 0
package/passport/index.php

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

+ 4 - 0
package/pay/index.php

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

+ 4 - 0
package/pdf/index.php

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

+ 4 - 0
package/pinyin/index.php

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

+ 4 - 0
package/poster/index.php

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

+ 4 - 0
package/push/index.php

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

+ 4 - 0
package/qrcode/index.php

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

+ 4 - 0
package/queue/index.php

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

+ 4 - 0
package/score/index.php

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

+ 4 - 0
package/share/index.php

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

+ 4 - 0
package/short/index.php

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

+ 4 - 0
package/sms/index.php

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

+ 4 - 0
package/token/index.php

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

+ 4 - 0
package/upload/index.php

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

+ 4 - 0
package/wechat_applet/index.php

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

+ 4 - 0
package/wechat_service/index.php

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