dever 3 anni fa
parent
commit
792232ee73
65 ha cambiato i file con 3311 aggiunte e 0 eliminazioni
  1. 2 0
      app/boot.php
  2. 112 0
      app/factory/database/goods.php
  3. 112 0
      app/factory/database/info.php
  4. 136 0
      app/factory/database/member.php
  5. 1 0
      app/factory/database/order.php
  6. 8 0
      app/factory/index.php
  7. 44 0
      app/goods/assets/manage/html/sku.html
  8. 188 0
      app/goods/database/freight.php
  9. 408 0
      app/goods/database/info.php
  10. 132 0
      app/goods/database/info_attr.php
  11. 65 0
      app/goods/database/info_category.php
  12. 224 0
      app/goods/database/info_sku.php
  13. 8 0
      app/goods/index.php
  14. 531 0
      app/goods/lib/Info.php
  15. 301 0
      app/goods/lib/Manage.php
  16. 7 0
      app/goods/template/manage/sku.php
  17. 8 0
      app/member/index.php
  18. 8 0
      app/shop/index.php
  19. 1 0
      app/store/database/goods.php
  20. 1 0
      app/store/database/info.php
  21. 8 0
      app/store/index.php
  22. 8 0
      boot.php
  23. 7 0
      common.php
  24. 150 0
      config/base.php
  25. 154 0
      config/env/localhost/default.php
  26. 6 0
      config/route.php
  27. 1 0
      data/readme
  28. 108 0
      main/database/cate.php
  29. 159 0
      main/database/config.php
  30. 113 0
      main/database/page.php
  31. 8 0
      main/index.php
  32. 16 0
      main/lib/Core.php
  33. 14 0
      main/page/list.php
  34. 22 0
      main/src/Api.php
  35. 33 0
      main/src/View.php
  36. 3 0
      package.json
  37. 4 0
      package/alibaba/index.php
  38. 4 0
      package/aliyun/index.php
  39. 7 0
      package/area/daemon/import.php
  40. 4 0
      package/area/index.php
  41. 4 0
      package/article/index.php
  42. 4 0
      package/attr/index.php
  43. 2 0
      package/boot.php
  44. 4 0
      package/category/index.php
  45. 4 0
      package/excel/index.php
  46. 4 0
      package/invite/index.php
  47. 88 0
      package/manage/config/base.php
  48. 7 0
      package/manage/daemon/loop.php
  49. 7 0
      package/manage/daemon/main.php
  50. 4 0
      package/manage/index.php
  51. 4 0
      package/message/index.php
  52. 4 0
      package/oauth/index.php
  53. 4 0
      package/passport/index.php
  54. 4 0
      package/pay/index.php
  55. 4 0
      package/poster/index.php
  56. 4 0
      package/push/index.php
  57. 4 0
      package/qrcode/index.php
  58. 4 0
      package/queue/index.php
  59. 4 0
      package/score/index.php
  60. 4 0
      package/share/index.php
  61. 4 0
      package/short/index.php
  62. 1 0
      package/sku/database/option.php
  63. 4 0
      package/sms/index.php
  64. 4 0
      package/token/index.php
  65. 4 0
      package/upload/index.php

+ 2 - 0
app/boot.php

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

+ 112 - 0
app/factory/database/goods.php

@@ -0,0 +1,112 @@
+<?php
+
+$role = array
+(
+    1 => '管理员',
+    2 => '配货员',
+    3 => '库存管理员',
+    4 => '财务',
+);
+
+$factory = function()
+{
+    $array = array();
+    $info = Dever::db('factory/info')->select();
+    
+    if($info)
+    {
+        $array += $info;
+    }
+    return $array;
+};
+
+$goods = function()
+{
+    $array = array();
+    $info = Dever::db('goods/info')->select();
+    
+    if($info)
+    {
+        $array += $info;
+    }
+    return $array;
+};
+
+return array
+(
+    # 表名
+    'name' => 'goods',
+    # 显示给用户看的名称
+    'lang' => '商品列表',
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'update'    => 'hidden',
+            //'list'        => true,
+        ),
+
+        'factory_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '所属工厂',
+            'default'   => '',
+            'desc'      => '所属工厂',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $factory,
+            'list'      => 'Dever::load("factory/info-find#name", {factory_id})';
+        ),
+
+        'goods_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '商品名称',
+            'default'   => '',
+            'desc'      => '商品名称',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $goods,
+            'list'      => 'Dever::load("goods/info-find#name", {goods_id})';
+        ),
+
+        '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,
+            'search'    => 'date',
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        
+    ),
+
+    'request' => array
+    (
+        
+    ),
+);

+ 112 - 0
app/factory/database/info.php

@@ -0,0 +1,112 @@
+<?php
+# 获取分类权限
+$status = array
+(
+    1 => '合作中',
+    2 => '已终止合作',
+),
+
+return array
+(
+    # 表名
+    'name' => 'info',
+    # 显示给用户看的名称
+    'lang' => '工厂列表',
+    # 后台菜单排序
+    'order' => 99,
+    # 数据结构
+    '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,
+        ),
+
+        'status'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '合作状态',
+            'default'   => '1',
+            'desc'      => '上线状态',
+            'match'     => 'is_numeric',
+            //'update'  => 'select',
+            'option'    => $status,
+            'search'    => 'select',
+            'list'      => true,
+            'edit'      => true,
+        ),
+
+        '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,
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    # 默认值
+    'default' => array
+    (
+        'col' => 'name,reorder,state,cdate',
+        'value' => array
+        (
+            '"默认工厂",1,1,' . time(),
+        ),
+    ),
+
+    'manage' => array
+    (
+        
+    ),
+
+    'request' => array
+    (
+        
+    ),
+);

+ 136 - 0
app/factory/database/member.php

@@ -0,0 +1,136 @@
+<?php
+
+$role = array
+(
+    1 => '管理员',
+    2 => '配货员',
+    3 => '库存管理员',
+    4 => '财务',
+);
+
+$factory = function()
+{
+    $array = array();
+    $info = Dever::db('factory/info')->select();
+    
+    if($info)
+    {
+        $array += $info;
+    }
+    return $array;
+};
+
+return array
+(
+    # 表名
+    'name' => 'member',
+    # 显示给用户看的名称
+    'lang' => '账号管理',
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'update'    => 'hidden',
+            //'list'        => true,
+        ),
+
+        'factory_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '所属工厂',
+            'default'   => '',
+            'desc'      => '所属工厂',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $factory,
+            'list'      => 'Dever::load("factory/info-find#name", {factory_id})';
+        ),
+
+        'name'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '员工姓名',
+            'default'   => '',
+            'desc'      => '请输入员工姓名',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'mobile'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '员工电话',
+            'default'   => '',
+            'desc'      => '请输入员工电话',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'avatar'        => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '员工头像',
+            'default'   => '',
+            'desc'      => '请选择员工头像',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '1',
+            'place'     => '150',
+        ),
+
+        'role_id'      => array
+        (
+            'type'      => 'varchar-60',
+            'name'      => '角色',
+            'default'   => '1',
+            'desc'      => '角色',
+            'match'     => 'is_numeric',
+            'update'    => 'checkbox',
+            'option'    => $role,
+            '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,
+            'search'    => 'date',
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        
+    ),
+
+    'request' => array
+    (
+        
+    ),
+);

+ 1 - 0
app/factory/database/order.php

@@ -0,0 +1 @@
+order.php

+ 8 - 0
app/factory/index.php

@@ -0,0 +1,8 @@
+<?php
+
+define('DEVER_APP_NAME', 'factory');
+define('DEVER_APP_LANG', '工厂管理');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+define('DEVER_MANAGE_ORDER', 60);
+define('DEVER_MANAGE_ICON', 'glyphicon glyphicon-tower layui-icon-flag');
+include(DEVER_APP_PATH . '../boot.php');

+ 44 - 0
app/goods/assets/manage/html/sku.html

@@ -0,0 +1,44 @@
+</form>
+<form class="layui-form form10" action="" target="f10" method="post">
+<input type="hidden" name="info_id" id="info_id" value="">
+<input type="hidden" name="function" id="function" value="skuMsg">
+<iframe id="f10" name="f10" style="display:none;"></iframe>
+    <div class="layui-form-item">
+        <table class="layui-table" id="sku">
+          <thead>
+            <tr>
+              <th>昵称</th>
+              <th>加入时间</th>
+              <th>签名</th>
+            </tr> 
+          </thead>
+          <tbody>
+            <tr>
+              <td>贤心</td>
+              <td>2016-11-29</td>
+              <td>人生就像是一场修行</td>
+            </tr>
+            <tr>
+              <td>许闲心</td>
+              <td>2016-11-28</td>
+              <td>于千万人之中遇见你所遇见的人,于千万年之中,时间的无涯的荒野里…</td>
+            </tr>
+          </tbody>
+        </table>
+    </div>
+
+    <div class="layui-form-item">
+        <div class="">
+          <button type="button" class="layui-btn" onclick="saveSku()">保存</button>
+        </div>
+    </div>
+<script>
+function saveSku()
+{
+    $('.form10').submit();
+}
+function skuMsg()
+{
+    showAlert('保存成功');
+}
+</script>

+ 188 - 0
app/goods/database/freight.php

@@ -0,0 +1,188 @@
+<?php
+$type = array
+(
+    1 => '数值',
+    2 => '百分比',
+);
+
+$pricing_type = array
+(
+    1 => '按件数',
+    //2 => '按重量',
+    //3 => '按体积',
+);
+return array
+(
+    # 表名
+    'name' => 'freight',
+    # 显示给用户看的名称
+    'lang' => '运费设置',
+    'order' => 1,
+
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            //'list'        => true,
+        ),
+
+        'category'      => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '分类',
+            'default'   => '',
+            'desc'      => '分类',
+            'match'     => 'is_string',
+            'search'    => 'linkage',
+            'update'    => 'linkage',
+            'option'    => Dever::url('api.get', 'category'),
+            'list'      => 'Dever::load("category/api.string", "{category}")',
+        ),
+
+        'goods_area'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '商品所在地区-先按照省份计算',
+            'default'   => '',
+            'desc'      => '商品所在地区',
+            'match'     => 'is_string',
+            //'search'  => 'linkage',
+            'update'    => 'linkage',
+            'option'    => Dever::url('api.get?level_total=1', 'area'),
+            'list'      => 'Dever::load("area/api.string", "{goods_area}")',
+        ),
+
+        'area'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '送达地区',
+            'default'   => '',
+            'desc'      => '送达地区',
+            'match'     => 'is_string',
+            'search'    => 'linkage',
+            'update'    => 'linkage',
+            'option'    => Dever::url('api.get?level_total=1', 'area'),
+            'list'      => 'Dever::load("area/api.string", "{area}")',
+        ),
+
+        'type'      => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '运费类型',
+            'default'   => '1',
+            'desc'      => '运费类型',
+            'match'     => 'option',
+            'update'    => 'radio',
+            'option'    => $type,
+            //'list'        => true,
+            //'search'  => 'select',
+        ),
+
+        'pricing_type'      => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '计价类型',
+            'default'   => '1',
+            'desc'      => '计价类型',
+            'match'     => 'option',
+            'update'    => 'radio',
+            'option'    => $pricing_type,
+            'list'      => true,
+            'search'    => 'select',
+        ),
+
+        'first_num'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '首件数量-如果计价类型是按重量,这里就是首件的重量,这里填写了2,就是满2件算首件',
+            'default'   => '',
+            'desc'      => '首件数量',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+        
+        'first_price'       => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '首件价格-如果是百分比类型,这里如果填的是10,那就是总价的10%',
+            'default'   => '',
+            'desc'      => '运费价格',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'next_num'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '续件数量-如果计价类型是按重量,这里就是续件的重量',
+            'default'   => '',
+            'desc'      => '续件数量',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+        
+        'next_price'        => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '续件价格-如果是百分比类型,这里如果填的是10,那就是总价的10%',
+            'default'   => '',
+            'desc'      => '续件价格',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'free'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '总价满多少减免运费',
+            'default'   => '',
+            'desc'      => '满多少减免运费',
+            'match'     => 'is_string',
+            //'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', DEVER_TIME),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        //'delete' => false,
+        //'edit' => false,
+        //'insert' => false,
+    ),
+
+    'request' => array
+    (
+        
+    )
+);

+ 408 - 0
app/goods/database/info.php

@@ -0,0 +1,408 @@
+<?php
+
+$status = Dever::config('base')->status;
+
+$price_type = array
+(
+    1 => '单一价格',
+    2 => '多种价格(需进行sku设置)',
+);
+
+$mode = array
+(
+    1 => '自提',
+    2 => '外卖',
+    3 => '外卖+自提',
+);
+
+$config = array
+(
+    # 表名
+    'name' => 'info',
+    # 显示给用户看的名称
+    'lang' => '商品列表',
+    'order' => 200,
+    'auto' => 10000000,
+
+    'end' => array
+    (
+        'insert' => 'goods/lib/manage.infoUpdate',
+        'update' => 'goods/lib/manage.infoUpdate',
+    ),
+
+    # 同步更新另外一个或多个表的数据,将数据同步到关联表中
+    'sync' => array
+    (
+        'goods/info_category' => array
+        (
+            # 更新另外一个表的字段 => 本表的字段
+            'where' => array('info_id', 'id'),
+            # 要更新的数据
+            'update' => array('category_id' => 'category'),
+            # 同步更新的类型,delete为先删再插入,update为直接更新
+            'type' => 'delete',
+        )
+    ),
+
+    # 数据结构 不同的字段放这里
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            //'list'        => true,
+        ),
+
+        'name'      => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '商品名称',
+            'default'   => '',
+            'desc'      => '商品名称',
+            'match'     => 'is_string',
+            'update'    => 'textarea',
+            'search'    => 'fulltext',
+            'list'        => true,
+            'edit'        => true,
+        ),
+
+        'category'      => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '分类',
+            'default'   => '',
+            'desc'      => '分类',
+            'match'     => 'is_string',
+            'search'    => 'linkage',
+            'update'    => 'linkage',
+            'option'    => Dever::url('api.get', 'category'),
+            //'list'        => 'Dever::load("category/api.string", "{category}")',
+        ),
+
+        # 以下几个分类其实在关联表中已经有了,放到这里是为了查询方便,一般只有三级分类,多了就从关联表查询吧
+        'top_category_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '顶级分类ID-顶级分类,用于分类查询',
+            'default'   => '-1',
+            'desc'      => '顶级分类ID',
+            'match'     => 'is_numeric',
+        ),
+
+        'second_category_id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '二级分类ID-二级分类,用于分类查询',
+            'default'   => '-1',
+            'desc'      => '二级分类ID',
+            'match'     => 'is_numeric',
+        ),
+
+        'category_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '子分类ID-最后一个级别的分类,用于分类查询',
+            'default'   => '-1',
+            'desc'      => '子分类ID',
+            'match'     => 'is_numeric',
+        ),
+
+        'area'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '所在地区',
+            'default'   => '',
+            'desc'      => '所在地区',
+            'match'     => 'is_string',
+            //'search'  => 'linkage',
+            'update'    => 'linkage',
+            'option'    => Dever::url('api.get?level_total=1', 'area'),
+            //'list'        => 'Dever::load("area/api.string", "{goods_area}")',
+        ),
+
+        'mode'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '取货形式',
+            'default'   => '1',
+            'desc'      => '取货形式',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $mode,
+        ),
+
+        'price_type'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '价格类型',
+            'default'   => '1',
+            'desc'      => '价格类型',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $price_type,
+            'control'   => 'price_type',
+        ),
+
+        'price'     => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '销售价',
+            'default'   => '',
+            'desc'      => '销售价',
+            'match'     => 'option',
+            'update'    => 'text',
+            'show'      => 'price_type=1',
+        ),
+
+        's_price'       => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '市场价',
+            'default'   => '',
+            'desc'      => '市场价',
+            'match'     => 'option',
+            'update'    => 'text',
+            'show'      => 'price_type=1',
+        ),
+
+        'cover'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '封面图-图片尺寸300*300px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式,用户上传图片之后会自动进行居中裁剪',
+            'default'   => '',
+            'desc'      => '封面图',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '1',
+            'place'     => '300*300',
+            'list_name' => '资源详情',
+            'list'      => 'Dever::load("goods/lib/manage.info", "{id}")',
+        ),
+
+        'pic'       => array
+        (
+            'type'      => 'text-255',
+            'name'      => '多张图片-图片尺寸750*422px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式,用户上传图片之后会自动进行居中裁剪',
+            'default'   => '',
+            'desc'      => '多张图片',
+            'match'     => 'option',
+            'update'    => 'images',
+            'key'       => '1',
+            'place'     => '750*422',
+        ),
+
+        'content'       => array
+        (
+            'type'      => 'text-800',
+            'name'      => '内容介绍',
+            'default'   => '',
+            'desc'      => '内容介绍',
+            'match'     => 'is_string',
+            'update'    => 'editor',
+            'key'       => '1',
+        ),
+
+        'status'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '状态',
+            'match'     => 'is_numeric',
+            //'update'  => 'select',
+            'option'    => $status,
+            'search'    => 'select',
+            'list'      => true,
+            'edit'      => true,
+        ),
+
+        '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',
+        ),
+
+        'udate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '更新时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+        ),
+
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '发布时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'search'    => 'date',
+            //'list'        => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    # 索引
+    'index' => array
+    (
+        1 => array
+        (
+            'search' => 'category,top_category_id,second_category_id,category_id,mode,area',
+        ),
+        
+        # 版本号 更改版本号会更新当前表的索引
+        'version' => 1,
+    ),
+    
+    # 管理功能
+    'manage' => array
+    (
+        // 载入自定义资源 路径可以配置在config里。这里没有写路径。demo.css
+        'res' => array
+        (
+            //'css' => 'demo',
+        ),
+        //'insert' => false,
+        //'delete' => false,
+        'mul' => true,
+        # 自定义快捷新增和编辑
+        'button' => array
+        (
+            //'类别管理' => array('list', 'cate&project=demand&search_option_key=cate&search_option_tablename=类别&oper_parent=info&oper_project=demand'),
+        ),
+
+        # 列表里的按钮
+        'list_button' => array
+        (
+            'add' => array('属性设置', '"info_attr
+                &project=goods
+                &search_option_info_id={id}
+                &search_option_category={category}
+                &oper_parent=info&oper_project=goods
+                &oper_save_jump=info
+                &where_id={id}"', '{price_type} == 2'),
+
+            'list' => array('sku设置', '"info_sku
+                &project=goods
+                &search_option_info_id={id}
+                &oper_parent=info&oper_project=goods
+                &oper_save_jump=info&page_type=1"', '{price_type} == 2'),
+            'br1' => array('<br />'),
+            'delete' => '删除',
+        ),
+    ),
+
+    # request 请求接口定义
+    'request' => array
+    (
+        # 后台搜索用到
+        'search' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'ids' => array('yes-id', 'in'),
+                'name' => array('yes', 'like'),
+                'id' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('reorder' => 'desc', 'id' => 'desc'),
+            'limit' => '0,1000',
+            'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
+        ),
+
+        # 列表
+        'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'audit' => 2,
+                'category' => array('yes', 'like'),
+                'top_category_id' => 'yes',
+                'second_category_id' => 'yes',
+                'category_id' => 'yes',
+                //'status' => 1,
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('reorder' => 'desc', 'id' => 'desc'),
+            'limit' => '0,10',
+            //'page' => array(10, 'list'),
+            'col' => '*',
+        ),
+
+        # 分页
+        'getPageAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'shop_id' => 'yes',
+                'brand_id' => 'yes',
+                'name' => array('yes', 'like'),
+                'audit' => 2,
+                'category' => array('yes', 'like'),
+                'top_category_id' => 'yes',
+                'second_category_id' => 'yes',
+                'category_id' => 'yes',
+                //'status' => 1,
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('reorder' => 'desc', 'id' => 'desc'),
+            'page' => array(10, 'list'),
+            'col' => '*',
+        ),
+        
+        # 更新售出量
+        'updateSell' => array
+        (
+            'type' => 'update',
+            'where' => array
+            (
+                'id' => 'yes',
+            ),
+            'set' => array
+            (
+                'sell_num' => array('yes', '+='),
+            ),
+        ),
+
+        'getOne' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'id' => 'yes',
+            ),
+            'type' => 'one',
+            'col' => 'id,name,category,brand_id,shop_id,pic_cover,pic,sell_num+sell_add_num as sell_num,content,platform,price_type,price,s_price,num-sell_num as num,link,code,mode,goods_area,shape,reward_value,reward_type',
+        ),
+    ),
+);
+
+return $config;

+ 132 - 0
app/goods/database/info_attr.php

@@ -0,0 +1,132 @@
+<?php
+list($category, $attr, $table, $create) = getInfoAttr();
+
+//print_r($attr);die;
+$config = array
+(
+    # 表名
+    'name' => 'info_attr' . $table,
+    # 显示给用户看的名称
+    'lang' => '属性规格',
+    'order' => 100,
+    'menu' => false,
+    'create' => $create,
+    'attr' => $attr,
+    'auto' => 10000000,
+
+    'end' => array
+    (
+        'insert' => 'attr/lib/manage.update',
+        'update' => 'attr/lib/manage.update',
+    ),
+
+    # 数据结构 不同的字段放这里
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'update'    => 'hidden',
+            'value'     => Dever::input('where_id')
+            //'list'        => true,
+        ),
+
+        'info_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '商品',
+            'default'   => '',
+            'desc'      => '商品',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_info_id')
+        ),
+
+        'category'      => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '分类-直接继承主表的分类',
+            'default'   => '',
+            'desc'      => '分类',
+            'match'     => 'is_string',
+            'update'    => 'hidden',
+            'value'     => $category
+        ),
+
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '发布时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            //'list'        => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    # 索引
+    'index' => array
+    (
+        1 => array
+        (
+            'search' => 'info_id',
+        ),
+        
+        # 版本号 更改版本号会更新当前表的索引
+        'version' => 1,
+    ),
+    
+    # 管理功能
+    'manage' => array
+    (
+
+    ),
+
+    # request 请求接口定义
+    'request' => array
+    (
+        # 分页
+        'getPageAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'audit' => array('yes-t_2.audit', 2),
+                'category' => array('yes-t_2.category', 'like'),
+                'top_category_id' => array('yes-t_2.top_category_id'),
+                'second_category_id' => array('yes-t_2.second_category_id'),
+                'category_id' => array('yes-t_2.category_id'),
+                //'status' => 1,
+                //'poster_pay_type' => array('yes-t_2.poster_pay_type', 2),
+                'state' => array('yes-t_2.state', 1),
+            ),
+            # 联表
+            'join' => array
+            (
+                array
+                (
+                    'table' => 'res/info',
+                    'type' => 'left join',
+                    'on' => array('info_id','id'),
+                    'col' => 'info_id',
+                ),
+            ),
+            'type' => 'all',
+            'order' => array('reorder' => 'desc', 't_1.id' => 'desc'),
+            'page' => array(10, 'list'),
+            'col' => '*',
+        ),
+    ),
+);
+
+
+# 属性完全自定义吧。这种情况用dever就是方便了。其他框架都需要自己实现
+Dever::load('attr/api')->setDatabaseConfig($attr, $config);
+
+return $config;

+ 65 - 0
app/goods/database/info_category.php

@@ -0,0 +1,65 @@
+<?php
+
+return array
+(
+    # 表名
+    'name' => 'info_category',
+    # 显示给用户看的名称
+    'lang' => '商品分类关联表',
+    'menu' => false,
+
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            //'list'        => true,
+        ),
+        
+        'info_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '商品ID',
+            'default'   => '',
+            'desc'      => '商品ID',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'category_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '分类ID',
+            'default'   => '',
+            'desc'      => '分类ID',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '录入时间',
+            'match'     => array('is_numeric', DEVER_TIME),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        'delete' => false,
+        'edit' => false,
+        'insert' => false,
+    ),
+);

+ 224 - 0
app/goods/database/info_sku.php

@@ -0,0 +1,224 @@
+<?php
+
+$config = array
+(
+    # 表名
+    'name' => 'info_sku',
+    # 显示给用户看的名称
+    'lang' => '商品价格设置',
+    'order' => 200,
+    'menu' => false,
+
+    # 数据结构 不同的字段放这里
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            //'list'        => true,
+        ),
+
+        'info_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '商品ID',
+            'default'   => '',
+            'desc'      => '商品ID',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'key'       => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '属性标识',
+            'default'   => '',
+            'desc'      => '属性标识',
+            'match'     => 'is_string',
+            'update'    => 'text',
+        ),
+
+        'attr'      => array
+        (
+            'type'      => 'text-255',
+            'name'      => '属性组合规则',
+            'default'   => '',
+            'desc'      => '属性组合规则',
+            'match'     => 'is_string',
+            'update'    => 'textarea',
+            'list'      => true,
+        ),
+
+        'price'     => array
+        (
+            'type'      => 'decimal-10,2',
+            'name'      => '售价',
+            'default'   => '',
+            'desc'      => '售价',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+
+        's_price'       => array
+        (
+            'type'      => 'decimal-10,2',
+            'name'      => '原价',
+            'default'   => '',
+            'desc'      => '原价',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'num'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '库存',
+            'default'   => '',
+            'desc'      => '库存',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'sell_num'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '销量',
+            'default'   => '0',
+            'desc'      => '请填写销量',
+            'match'     => 'option',
+            'search'    => 'order',
+            'list'      => true,
+        ),
+
+        '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,
+            //'search'  => 'date',
+            //'list'        => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        'insert' => false,
+        'edit' => false,
+        'delete' => false,
+        'num' => false,
+        'page_list_table' => 'sku',
+
+        # 自定义快捷新增和编辑
+        'button' => array
+        (
+            '自定义属性' => array('fast', 1, 'config&where_id=1'),
+        ),
+    ),
+
+    # request 请求接口定义
+    'request' => array
+    (
+        # 列表
+        'getData' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'info_id' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('id' => 'desc'),
+            'col' => '*,num-sell_num as num|key',
+        ),
+
+        # 获取单条数据
+        'getOne' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'info_id' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'one',
+            'col' => '*,num-sell_num as num',
+        ),
+
+        'getMinOne' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'info_id' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'one',
+            'order' => array('price' => 'asc', 'id' => 'desc'),
+            'col' => '*',
+        ),
+
+        'getMaxOne' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'info_id' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'one',
+            'order' => array('price' => 'desc', 'id' => 'desc'),
+            'col' => '*',
+        ),
+
+        # 更新售出量
+        'updateSell' => array
+        (
+            'type' => 'update',
+            'where' => array
+            (
+                'id' => 'yes',
+            ),
+            'set' => array
+            (
+                'sell_num' => array('yes', '+='),
+            ),
+        ),
+    ),
+);
+
+return $config;

+ 8 - 0
app/goods/index.php

@@ -0,0 +1,8 @@
+<?php
+
+define('DEVER_APP_NAME', 'goods');
+define('DEVER_APP_LANG', '商品管理');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+define('DEVER_MANAGE_ORDER', 98);
+define('DEVER_MANAGE_ICON', 'glyphicon glyphicon-tower layui-icon-component');
+include(DEVER_APP_PATH . '../boot.php');

+ 531 - 0
app/goods/lib/Info.php

@@ -0,0 +1,531 @@
+<?php
+
+# 核心类,数据获取类
+
+namespace Goods\Lib;
+
+use Dever;
+
+class Info
+{
+    private $table_info = 'goods/info';
+    private $table_attr = 'goods/info_attr';
+    /**
+     * instance
+     *
+     * @var string
+     */
+    protected static $instance;
+
+    /**
+     * init
+     *
+     * @return mixed
+     */
+    public static function init($top_category = false)
+    {
+        if (empty(self::$instance[$top_category])) {
+            self::$instance[$top_category] = new self($top_category);
+        }
+
+        return self::$instance[$top_category];
+    }
+
+    public function __construct($top_category = false)
+    {
+        $this->top_category = $top_category;
+
+        # 必有有分类才能进入到需求中
+        if (!$this->top_category) {
+            $this->top_category = -1;
+            //Dever::alert('错误的分类信息');
+        }
+    }
+
+    private function setAttr($cate, $order = 'list_reorder')
+    {
+        if ($order != 'list_reorder') {
+            Dever::config('base')->attrOrder = $order;
+        }
+        
+        Dever::setInput('search_option_category', $cate);
+        $attr = Dever::db($this->table_attr, array(), $cate);
+        return $attr;
+    }
+
+    public function getAttr($cate)
+    {
+        return Dever::load('attr/api')->getAttrByCate($cate, 'list');
+    }
+
+    # 根据分类获取需求列表数据
+    public function getData($cate = false, $limit = '0,10', $page = false, $attr = true)
+    {
+        if (!$limit) {
+            $limit = '0,10';
+        }
+        $where = $data = array();
+        if (!$cate) {
+            if ($this->top_category > 0) {
+                $where['top_category_id'] = $this->top_category;
+            }
+        } elseif (strstr($cate, ',')) {
+            $where['category'] = $this->top_category . ',' . $cate;
+        } else {
+            $where['second_category_id'] = $cate;
+        }
+        
+        if ($page) {
+            $method = 'getPageAll';
+        } else {
+            $where['limit'] = $limit;
+            $method = 'getAll';
+        }
+        $name = Dever::input('name');
+        if ($name) {
+            $where['name'] = $name;
+        }
+        $data = Dever::db($this->table_info)->$method($where);
+        if ($data && $attr) {
+            foreach ($data as $k => $v) {
+                $data[$k] = $this->info($v, 'list_reorder');
+            }
+        }
+
+        return $data;
+    }
+
+    # 根据属性获取需求列表数据 这里带有检索属性的功能 此处还需优化
+    public function getDataByAttr($cate = false, $where = array())
+    {
+        if (!$cate) {
+            Dever::alert('错误的分类信息');
+        }
+        $where_sql = array();
+        $name = Dever::input('name');
+        if ($name) {
+            //$where['name'] = $name;
+            $where_sql[] = ' t_2.name = "'.$name.'"';
+        }
+
+        $attr = $this->setAttr($this->top_category . ',' . $cate);
+        //print_r($attr->config['attr']);
+
+        $where_sql = Dever::load('attr/api')->getSql($attr->config['attr'], $where, $where_sql);
+        if (!$where_sql) {
+            return array();
+        }
+        # 这里用pdo的数据绑定,字符串字段的区间查询就是有问题。。。只能用sql了
+        //$data = $attr->getPageAll($where);
+
+        $page['template'] = 'list';
+        $page['num'] = 10;
+        $where_sql = implode(' and ', $where_sql);
+
+        $sql = 'SELECT t_2.* FROM `info_goods_'.$attr->config['name'].'` as t_1 Left Join `info_goods_info` AS t_2 ON t_1.`info_id`=t_2.`id` WHERE '.$where_sql.' order by t_2.`reorder` desc,t_2.`id` desc';
+
+        $data = $attr->fetchAll($sql, array(), $page);
+
+        if ($data) {
+            foreach ($data as $k => $v) {
+                $data[$k] = $this->info($v, 'list_reorder');
+            }
+        }
+
+        return $data;
+    }
+
+    # 获取列表页的搜索条件
+    public function getSearch($cate = false)
+    {
+        # 获取搜索条件
+        if (!$cate) {
+            $search_cate = $cate = $this->top_category;
+        } else {
+            $search_cate = $cate;
+        }
+        # 1是当前用户所在的城市,暂时写死
+        # 获取搜索条件
+        $search = Dever::load('attr/api')->getSearch($search_cate, true, 1, false, 2);
+        # 下级分类
+        $search['cate'] = Dever::load('category/api')->getList($cate);
+
+        # 上级分类
+        $search['parent_cate'] = Dever::load('category/api')->getList($this->top_category);
+        return $search;
+    }
+
+    # 获取支付信息
+    public function getPayState($uid, $id, $category)
+    {
+        $pay_where['category'] = $category;
+        $pay = Dever::db('goods/pay')->one($pay_where);
+        $pay_state = 0;
+        if ($pay && $pay['num'] > 0) {
+            $pay_state = $pay['num'];
+        } elseif (strstr($category, ',')) {
+            $category = explode(',', $category);
+            $category = array_pop($category);
+            $pay_state = $this->getPayState($uid, $id, $category);
+        }
+
+        //$update['where_id'] = $id;
+        //$update['poster_pay_type'] = $pay_state;
+        //Dever::db($this->table_info)->update($update);
+
+        return $pay_state;
+    }
+
+    # 更新需求
+    public function update($top, $cate, $data, $id, $uid)
+    {
+        if ($cate) {
+            $category = $top . ',' . $cate;
+        } else {
+            $category = $top;
+        }
+        $attr = $this->setAttr($category);
+
+        $attr_update = Dever::preInput('attr_');
+        if ($attr_update) {
+            foreach ($attr_update as $k => $v) {
+                if (strstr($k, '_s')) {
+                    $k = str_replace('_s', '', $k);
+                    $attr_update[$k] = $v;
+                }
+                if (strstr($k, '_e')) {
+                    $k = str_replace('_e', '', $k);
+                    $attr_update[$k] .= ',' . $v;
+                }
+            }
+        }
+
+        $update = array();
+        $update['name'] = $data['name'];
+        $update['category'] = $category;
+        $update['pic'] = $data['pic'];
+        //$update['pic_cover'] = $data['pic'];
+        $update['poster_uid'] = $uid;
+        if (isset($data['view_price']) && $data['view_price']) {
+            $update['view_price'] = $data['view_price'];
+        }
+        if ($uid && $id) {
+            # 此处要判断是用户自己的
+            $info = Dever::db($this->table_info)->one($id);
+
+            /*
+            if ($uid == $info['poster_uid']) {
+                Dever::alert('错误的用户参数');
+            }
+            */
+            $update['where_id'] = $attr_update['where_id'] = $id;
+            Dever::db($this->table_info)->update($update);
+            Dever::db($this->table_attr)->update($attr_update);
+            $pay = 0;
+        } else {
+            $id = Dever::db($this->table_info)->insert($update);
+            $attr_update['category'] = $update['category'];
+            $attr_update['info_id'] = $id;
+            $attr_update['id'] = $id;
+            Dever::db($this->table_attr)->insert($attr_update);
+
+            # 验证是否需要支付,根据category判断
+            $pay = false;
+            //$pay = $this->getPayState($uid, $id, $category);
+
+            $info = Dever::db($this->table_info)->one($id);
+            $info = $this->getInfoLink($info);
+        }
+        return array('id' => $id, 'pay' => $pay, 'cate' => $category, 'top' => $top, 'info' => $info);
+    }
+
+    # 获取支付所需要的信息
+    public function getPayInfo($id, $sku, $num = 1, $user = array())
+    {
+        $info = Dever::db($this->table_info)->getOne($id);
+
+        if ($info) {
+            $info['freight_id'] = 0;
+            $info['freight_price'] = 0;
+            if ($sku > 0) {
+                $where['info_id'] = $info['id'];
+                $where['id'] = $sku;
+                $sku = Dever::db('goods/info_sku')->getOne($where);
+                if ($sku) {
+                    $info['price'] = $sku['price'];
+                    $info['num'] = $sku['num'];
+                }
+            }
+            $freight = $this->freight($info, $info['price'], $user, $num);
+            if ($freight) {
+                $info['freight_id'] = $freight['id'];
+                $info['freight_price'] = $freight['price'];
+            }
+
+            # 佣金计算
+            $info['reward'] = $this->reward($info, $info['price']*$num);
+        }
+
+        return $info;
+    }
+
+    # 获取自提信息
+    public function storeInfo($goods_id, $area_id = '')
+    {
+        $info = Dever::db($this->table_info)->getOne($goods_id);
+        if (!$info) {
+            return array();
+        }
+        $array = explode(',', $info['category']);
+        $cate = $store = array();
+        $total = count($array);
+        $total -= 1;
+        # 用户所在地理位置 
+        if ($area_id) {
+            $where['area'] = $area_id;
+        }
+        foreach ($array as $k => $v) {
+            $cate[$k] = $v;
+            if ($k < $total) {
+                $cate[] = '-1';
+            }
+            $where['category'] = $cate;
+
+            $data = Dever::db('goods/store')->state($where);
+            if ($data) {
+                $store += $data;
+            }
+        }
+
+        return $store;
+    }
+
+    # 获取运费信息
+    public function getFreight($id, $goods_price, $user, $num)
+    {
+        $info = Dever::db($this->table_info)->getOne($id);
+        return $this->freight($info, $goods_price, $user, $num);
+    }
+
+    # 获取基本信息
+    public function getInfo($id, $attr = true, $order = 'view_reorder', $user = array(), $reward = false)
+    {
+        $info = Dever::db($this->table_info)->getOne($id);
+
+        if ($info && $attr) {
+            $info = $this->info($info, $order, false, $user, $reward);
+        }
+
+        if ($info['pic']) {
+            $info['pic'] = explode(',', $info['pic']);
+        }
+
+        return $info;
+    }
+
+    # 获取基本信息
+    public function info($info, $key = 'list_reorder', $is_sell = false, $user = array(), $reward = false)
+    {
+        if ($info['price_type'] == 2) {
+            
+            $attr = $this->setAttr($info['category'], $key);
+            $attr_data = $attr->one($info['id']);
+            $info['category_array'] = Dever::load('category/api')->string($info['category']);
+
+            $info['attr'] = $info['sell_attr'] = array();
+
+            if ($attr->config['attr']) {
+                foreach ($attr->config['attr'] as $k => $v) {
+                    if (isset($v[$key]) && $v[$key] > 0) {
+                        if (isset($attr_data['attr_' . $v['id']])) {
+                            $v['value'] = $attr_data['attr_' . $v['id']];
+                        } else {
+                            continue;
+                            $v['value'] = '';
+                        }
+
+                        $v['value_string'] = Dever::load('attr/api')->getValue($v);
+                        
+                        if ($v['ename'] == 'price') {
+                            $info['price'] = $v['value_string'];
+                        } else {
+                            $v['bg'] = 'background-image: url('.$v['icon'].')';
+                            $v['pic'] = '<img src="'.$v['icon'].'" width="18" />';
+                            if ($is_sell > 0) {
+                                if ($is_sell == $v['is_sell']) {
+                                    $info['attr'][] = $v;
+                                }
+                                
+                            } else {
+                                $info['attr'][] = $v;
+                                # 设置sku
+                                $this->sku($v, $info);
+                            }
+                        }
+                    }
+                }
+            }
+        } else {
+            $price = $info['price'];
+            $s_price = $info['s_price'];
+            $info['price'] = array();
+            $info['price']['list'] = array();
+            $info['price']['min'] = array
+            (
+                'price' => $price,
+                's_price' => $s_price
+            );
+            $info['price']['max'] = array();
+        }
+
+        $info['platform_name'] = Dever::db('goods/info')->config['config_platform'][$info['platform']];
+       
+        if (isset($info['cdate']) && $info['cdate']) {
+            $info['cdate_string'] = Dever::mdate($info['cdate'], 2);
+        }
+
+        $info = $this->getInfoLink($info);
+
+        $info['freight'] = 0;
+        if ($info['platform'] == 1 && $user) {
+            # 获取运费
+            $info['freight'] = $this->freight($info, $info['price']['min']['price'], $user);
+        }
+        # 佣金计算
+        if ($reward) {
+            $info['reward'] = $this->reward($info, $info['price']['min']['price']);
+        }
+
+        return $info;
+    }
+
+    # 佣金计算
+    private function reward($info, $price)
+    {
+        if ($info['reward_value'] && $info['reward_value'] > 0) {
+            if ($info['reward_type'] == 2) {
+                $info['reward_value'] = round(($info['reward_value']/100) * $price, 2);
+            }
+            return $info['reward_value'];
+        }
+        $array = explode(',', $info['category']);
+        $cate = $reward = array();
+        $total = count($array);
+        $total -= 1;
+        foreach ($array as $k => $v) {
+            $cate[$k] = $v;
+            if ($k < $total) {
+                $cate[] = '-1';
+            }
+            $where['category'] = $cate;
+
+            $data = Dever::db('goods/reward')->one($where);
+            if ($data) {
+                $reward = $data;
+            }
+        }
+
+        if ($reward) {
+            if ($reward['value'] && $reward['value'] > 0) {
+                if ($reward['type'] == 2) {
+                    $reward['value'] = round(($reward['value']/100) * $price, 2);
+                }
+                return $reward['value'];
+            }
+        }
+
+        return 0;
+    }
+
+    # 运费计算,暂时用省份代表地区
+    private function freight($info, $goods_price, $user = array(), $num = 1)
+    {
+        $array = explode(',', $info['category']);
+        $cate = $freight = array();
+        $total = count($array);
+        $total -= 1;
+        if ($info && $info['goods_area']) {
+            $where['goods_area'] = $info['goods_area'];
+        }
+        # 用户所在地理位置 
+        if ($user && isset($user['area_id']) && $user['area_id']) {
+            $area = explode(',', $user['area_id']);
+            $where['area'] = $area[0];
+        }
+        foreach ($array as $k => $v) {
+            $cate[$k] = $v;
+            if ($k < $total) {
+                $cate[] = '-1';
+            }
+            $where['category'] = $cate;
+
+            $data = Dever::db('goods/freight')->one($where);
+            if ($data) {
+                $freight = $data;
+            }
+        }
+
+        if ($freight) {
+            $price = $freight['first_price'];
+            if ($num > $freight['first_num']) {
+                $num = $num - $freight['first_num'];
+                $price = $freight['first_price'] + ($freight['next_price']*$num);
+            }
+
+            if ($freight['type'] == 2) {
+                $freight['price'] = round($goods_price*$num*($price/100), 2);
+            } else {
+                $freight['price'] = $price;
+            }
+        }
+
+        return $freight;
+    }
+
+    private function sku($data, &$info)
+    {
+        # 获取销售属性
+        if ($data['is_sell'] == 2) {
+            if ($data['option']) {
+                $value = explode(',', $data['value']);
+                foreach($data['option'] as $k => $v) {
+                    if (in_array($v['id'], $value)) {
+                        $data['option_sku'][] = array
+                        (
+                            'id' => $v['id'],
+                            'info_id' => $v['info_id'],
+                            'name' => $v['name'],
+                            'icon' => $v['icon'],
+                            'value' => $v['info_id'] . '-' . $v['id'],
+                        );
+                    }
+                }
+                unset($data['option']);
+            }
+            
+            $info['sell_attr'][] = $data;
+
+            # 获取最便宜的价格
+            $where['info_id'] = $info['id'];
+            $info['price'] = array();
+            $info['price']['list'] = Dever::db('goods/info_sku')->getData($where);
+            $info['price']['min'] = Dever::db('goods/info_sku')->getMinOne($where);
+            $info['price']['max'] = Dever::db('goods/info_sku')->getMaxOne($where);
+        }
+    }
+
+    public function getInfoLink($info)
+    {
+        if (isset($this->view_path)) {
+            $info['view_path'] = $this->view_path . '?top=' . $info['top_category_id'] . '&id=' . $info['id'];
+            $info['view_link'] = Dever::url($info['view_path']);
+        }
+
+        return $info;
+    }
+
+    public function setViewPath($path)
+    {
+        $this->view_path = $path;
+    }
+}

+ 301 - 0
app/goods/lib/Manage.php

@@ -0,0 +1,301 @@
+<?php
+
+namespace Goods\Lib;
+
+use Dever;
+
+class Manage
+{
+    public function search_api()
+    {
+        $table = 'goods/info';
+        $keyword = Dever::input('keyword');
+
+        $yes = Dever::input('yes');
+
+        $where = array();
+
+        $cate = Dever::input('cate');
+        if ($cate) {
+            $where['cate_id'] = $cate;
+        }
+
+        if ($yes) {
+            $yes = Dever::db($table)->search(array('ids' => $yes));
+        }
+        if (!$keyword) {
+            $where['limit'] = '0,50';
+            $data = Dever::db($table)->search($where);
+        } else {
+            $where['name'] = $keyword;
+            $data = Dever::db($table)->search($where);
+        }
+
+        $result = array();
+        if ($yes) {
+            foreach ($yes as $k => $v) {
+                if (isset($data[$k])) {
+                    unset($data[$k]);
+                }
+                $yes[$k]['selected'] = 'selected';
+            }
+            $data = $yes + $data;
+
+            $data = array_merge($data, array());
+        } else {
+            $data = array_merge($data, array());
+        }
+
+        if (!$data) {
+            Dever::alert('暂无数据');
+        }
+
+        return $data;
+    }
+
+    /**
+     * 更新信息
+     *
+     * @return mixed
+     */
+    public function infoUpdate($id, $name, $data)
+    {
+        # 更新分类id
+        $category = Dever::param('category', $data);
+        if ($category) {
+            if (is_array($category)) {
+                $category_id = end($category);
+                $top_category_id = $category[0];
+                if (isset($category[1])) {
+                    $second_category_id = $category[1];
+                } else {
+                    $second_category_id = $category[0];
+                }
+                
+            } else {
+                $category_id = $category;
+                $top_category_id = $category;
+                $second_category_id = $category;
+            }
+            
+
+            $update['top_category_id'] = $top_category_id;
+            $update['second_category_id'] = $second_category_id;
+            $update['category_id'] = $category_id;
+            
+        }
+
+        $pic = Dever::param('pic', $data);
+        $pic_cover = Dever::param('pic_cover', $data);
+        if ($pic && !$pic_cover) {
+            if (is_string($pic)) {
+                $pic = explode(',', $pic);
+            }
+            $update['pic_cover'] = $pic[0];
+        }
+
+        if (isset($update)) {
+            $update['where_id'] = $id;
+            Dever::db('goods/info')->update($update);
+        }
+    }
+
+    /**
+     * 更新需求属性信息
+     *
+     * @return mixed
+     */
+    public function attrUpdate($id, $name, $data)
+    {
+        print_r($data);die;
+        foreach ($data as $k => $v) {
+
+        }
+    }
+
+    /**
+     * 显示信息
+     *
+     * @return mixed
+     */
+    public function info($id)
+    {
+        $info = Dever::db('goods/info')->one($id);
+        if ($info) {
+            $table['编号'] = $info['id'];
+            $table['标题'] = $info['name'];
+            $table['分类'] = Dever::load("category/api.string", $info['category']);
+
+            if ($info['pic']) {
+                $table['商品图'] = '<img src="'.$info['pic'].'" width="150" />';
+            }
+
+            //$table['属性'] = $this->attrInfo($info);
+
+            if ($info['cdate']) {
+                $table['发布时间'] = date("Y-m-d H:i:s", $info['cdate']);
+            }
+            if ($info['udate']) {
+                $table['更新时间'] = date("Y-m-d H:i:s", $info['udate']);
+            }
+        }
+
+        return Dever::table($table);
+    }
+
+    private function attrInfo($info)
+    {
+        $table = array();
+
+        $info = Info::init($info['top_category_id']);
+
+        if ($info) {
+            $info = $info->info($info, 'id');
+            if ($info && isset($info['attr'])) {
+                foreach ($info['attr'] as $k => $v) {
+                    $table[$v['name']] = $v['value_string'];
+                }
+            }
+        }
+        
+        return Dever::table($table);
+    }
+
+    public function area($id, $name, $data)
+    {
+        # 不再执行syncone等后续操作
+        Dever::config('base')->after = 1;
+
+        $type = Dever::input('type');
+
+        $area = Dever::param('area', $data);
+
+        if ($area) {
+
+            if (isset($area[2])) {
+                $update['district_id'] = $area[2];
+            }
+
+            if (isset($area[1])) {
+                $update['city_id'] = $area[1];
+            }
+
+            if (isset($area[0])) {
+                $update['province_id'] = $area[0];
+            }
+
+            if (isset($update)) {
+                $update['where_id'] = $id;
+
+                Dever::db($type . '/info')->update($update);
+            }
+        }
+    }
+
+    public function skuConfig()
+    {
+        $data['action'] = Dever::url('goods/lib/manage.skuUp');
+        $data['info_id'] = Dever::input('search_option_info_id');
+        return $data;
+    }
+
+    public function skuUp_api()
+    {
+        $info_id = Dever::input('info_id');
+        $attr = Dever::input('attr');
+        $key = Dever::input('key');
+        $price = Dever::input('price');
+        $s_price = Dever::input('s_price');
+        $num = Dever::input('num');
+
+        if ($key) {
+            foreach ($key as $k => $v) {
+                if (isset($price[$k]) && $price[$k]) {
+                    $info = Dever::db('goods/info_sku')->one(array('key' => $v));
+                    $data['info_id'] = $info_id;
+                    $data['attr'] = $attr[$k];
+                    $data['key'] = $v;
+                    $data['price'] = $price[$k];
+                    $data['s_price'] = $s_price[$k];
+                    $data['num'] = $num[$k];
+                    if (!$info) {
+                        Dever::db('goods/info_sku')->insert($data);
+                    } else {
+                        $data['where_id'] = $info['id'];
+                        Dever::db('goods/info_sku')->update($data);
+                    }
+                }
+            }
+        }
+
+        Dever::out('yes');
+    }
+
+    public function skuInput()
+    {
+        $id = Dever::input('search_option_info_id');
+
+        $sku = Dever::db('goods/info_sku')->getData(array('info_id' => $id));
+
+        $info = Dever::db('goods/info')->one($id);
+
+        $info = Info::init(-1)->info($info, 'list_reorder');
+
+        $html = '请先选择属性';
+        if ($info['sell_attr']) {
+            $head = '<thead><tr>';
+            $body = '<tbody>';
+            $option = array();
+            foreach ($info['sell_attr'] as $k => $v) {
+                $head .= '<th>'.$v['name'].'</th>';
+                if (isset($v['option_sku'])) {
+                    $option[$k] = $v['option_sku'];
+                }
+            }
+
+            $head .= '<th>原价</th>';
+            $head .= '<th>现价</th>';
+            $head .= '<th>库存</th>';
+            $head .= '</tr></thead>';
+
+            if ($option) {
+                $option = Dever::cartesian($option);
+
+                foreach ($option as $k => $v) {
+                    $body .= '<tr data-row="' .($k+1). '">';
+
+                    $key = $id = array();
+                    foreach ($v['name'] as $k1 => $v1) {
+                        $rows = 1;
+                        $body .= '<td width="50" rowspan="'.$rows.'">'.$v1.'</td>';
+                        $id[] = array
+                        (
+                            'id' => $v['id'][$k1],
+                            'attr_id' => $v['info_id'][$k1],
+                        );
+                        $key[] = $v['info_id'][$k1] . '-' . $v['id'][$k1];
+                    }
+                    $key = implode('_', $key);
+                    $s_price = $price = $num = '';
+                    if (isset($sku[$key])) {
+                        $s_price = $sku[$key]['s_price'];
+                        $price = $sku[$key]['price'];
+                        $num = $sku[$key]['num'];
+                    }
+                    $body .= '<td width="30"><input type="text" class="layui-input" name="s_price['.$k.']" value="'.$s_price.'"/></td>';
+                    $body .= '<td width="30"><input type="text" class="layui-input" name="price['.$k.']"  value="'.$price.'"/></td>';
+                    $body .= '<td width="30"><input type="text" class="layui-input" name="num['.$k.']"  value="'.$num.'"/><input type="hidden" name="key['.$k.']" value="'.$key.'"/><textarea style="display:none;" name="attr['.$k.']"/>'.json_encode($id).'</textarea></td>';
+                    $body .= '</tr>';
+                }
+            }
+
+            $body .= '</tbody>';
+            
+            $html = $head . $body;
+        }
+
+        return $html;
+    }
+
+
+}

+ 7 - 0
app/goods/template/manage/sku.php

@@ -0,0 +1,7 @@
+<?php
+
+$view
+->fetch('.form10@action', 'goods/lib/manage.skuConfig#action')
+->fetch('#info_id@value', 'goods/lib/manage.skuConfig#info_id')
+->fetch('#sku', 'goods/lib/manage.skuInput')
+->display();

+ 8 - 0
app/member/index.php

@@ -0,0 +1,8 @@
+<?php
+
+define('DEVER_APP_NAME', 'member');
+define('DEVER_APP_LANG', '客户管理');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+define('DEVER_MANAGE_ORDER', 90);
+define('DEVER_MANAGE_ICON', 'glyphicon glyphicon-tower layui-icon-username');
+include(DEVER_APP_PATH . '../boot.php');

+ 8 - 0
app/shop/index.php

@@ -0,0 +1,8 @@
+<?php
+
+define('DEVER_APP_NAME', 'shop');
+define('DEVER_APP_LANG', '门店管理');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+define('DEVER_MANAGE_ORDER', 80);
+define('DEVER_MANAGE_ICON', 'glyphicon glyphicon-tower layui-icon-component');
+include(DEVER_APP_PATH . '../boot.php');

+ 1 - 0
app/store/database/goods.php

@@ -0,0 +1 @@
+goods.php

+ 1 - 0
app/store/database/info.php

@@ -0,0 +1 @@
+index.php

+ 8 - 0
app/store/index.php

@@ -0,0 +1,8 @@
+<?php
+
+define('DEVER_APP_NAME', 'store');
+define('DEVER_APP_LANG', '仓库管理');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+define('DEVER_MANAGE_ORDER', 70);
+define('DEVER_MANAGE_ICON', 'glyphicon glyphicon-tower layui-icon-template-1');
+include(DEVER_APP_PATH . '../boot.php');

+ 8 - 0
boot.php

@@ -0,0 +1,8 @@
+<?php
+define('DEVER_PROJECT', 'churen');
+define('DEVER_PROJECT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+if (defined('DEVER_PACKAGE')) {
+	include('dever_package/'.DEVER_PACKAGE.'/index.php');
+} else {
+	include('dever/boot.php');
+}

+ 7 - 0
common.php

@@ -0,0 +1,7 @@
+<?php
+
+function getInfoAttr()
+{
+    $category = Dever::input('search_option_category', Dever::input('update_category'));
+    return Dever::load('attr/api')->getInfoAttr($category);
+}

+ 150 - 0
config/base.php

@@ -0,0 +1,150 @@
+<?php
+$config['base'] = array
+(
+	'name' => '厨人易料平台',
+	'version' => '1.0.0 Beta',
+
+    # 设置分类组件中的栏目下的分类为系统使用的主分类
+    'category' => 1,
+
+    # 后台头部菜单
+    'top' => 'passport/system_id',
+
+    # 上线状态
+    'status' => array
+    (
+        1 => '上架',
+        2 => '下架',
+    ),
+
+    # 小程序配置
+    'applet' => array
+    (
+        'project' => 'passport/system',
+        'url' => 'https://api.weixin.qq.com/sns/jscode2session',
+        # 首页
+        'index' => 'pages/index/index',
+    ),
+
+    # 加密key
+    'encode_key' => 'dreamland1985',
+
+    # 站点使用邮箱还是手机作为主账号
+    'account' => 'mobile',
+
+    'mobileCode' => array
+    (
+        # debug模式
+        'debug' => true,
+        # 发送短信的接口
+        'url' => 'https://feginesms.market.alicloudapi.com/codeNotice',
+        'url' => '',
+        # 保存方式 cookie、session、db 三种可选 默认为session
+        'save' => 'db',
+        # 发送方法 get、post
+        'method' => 'get',
+        # 是否json编码
+        'json' => false,
+        # header信息
+        'header' => 'Authorization:APPCODE ca584ae21ce54c999067e77b5995a27b',
+        # body信息
+        'body' => 'param={code}&phone={mobile}&sign={sign}&skin={skin}',
+        # 短信模板 发送短信时,请加上参数skin=1
+        'skin' => array
+        (
+            'reg' => 35247,
+            'order' => 35246,
+            'code' => 35245,
+            # 需要增加一个notice
+            'notice' => 38099,
+            # order的反馈方案修改后
+            'feedback' => 38747,
+        ),
+        # 短信签名
+        'sign' => 47159,
+        # 验证码有效期 默认10分钟
+        'timeout' => 600,
+        # 一天之内的最大发送次数,默认为10次
+        'total' => 10,
+        # 不允许多久之内重复发送,默认为60秒
+        'time' => 60,
+        # 验证码长度
+        'length' => 6,
+    ),
+    # 注册成功后,调取的接口
+    'regAction' => '',
+
+    # 注册成功后,是否发送短信,直接使用skin的key即可
+    //'regSendSms' => 'reg',
+
+    # 用户中心的列表中显示的项目
+    'passport_list_button' => array
+    (
+        /*
+        'list1' => array('订单', '"order&project=act&search_option_uid={id}&oper_parent=user&oper_project=passport"'),
+        'list2' => array('兑换码', '"info&project=code&search_option_create_uid={id}&oper_parent=user&oper_project=passport"'),
+        'list3' => array('积分', '"user&project=score&search_option_uid={id}&oper_parent=user&oper_project=passport"'),
+        */
+    ),
+
+    # 日志系统
+    'log' => array
+    (
+        'cron' => array
+        (
+            'ad/lib/cron.run'
+        ),
+    ),
+
+    # 积分配置
+    'score' => array
+    (
+        # 实时增加积分开启,关闭则需要把lib/core.cron放到计划任务中
+        'sync' => true,
+    ),
+
+    # 启用全站图片压缩
+    //'pic' => 'yun_t1',
+
+    # 队列
+    'queue' => array
+    (
+        'method' => 'redis',
+        'host' => 'server-redis',
+        'port' => '6379',
+        'password' => 'dm_redis_123',
+    ),
+);
+
+
+# 前台通用配置
+$config['template'] = array
+(
+    # 静态页面目录
+    //'assets' => array('pc', 'mobile'),
+    'assets' => 'mobile',
+
+    # 模板编译器目录
+    'template' => 'mobile',
+
+    # 模板html文件的所在目录,默认为html
+    'path' => '',
+
+    'replace' => array
+    (
+        'css' => 'css/',
+        'js' => 'js/',
+        'images' => 'images/',
+        'script' => 'script/',
+        'static' => './static/',
+    ),
+
+    # 编译器与模板对应关系目录,定义之后,代表可以完全不改动前端的代码,可以为空,为空则一一对应,参考manage
+    'relation' => array
+    (
+        # 首页启动屏幕
+        'home' => 'page',
+    ),
+    
+);
+return $config;

+ 154 - 0
config/env/localhost/default.php

@@ -0,0 +1,154 @@
+<?php
+
+# 验证dc是否存在,一般在share目录下
+$dc = array();
+$dc_file = '/share/dc/config.php';
+if (is_file($dc_file)) {
+    $dc = include($dc_file);
+}
+# 基本配置
+$config['base'] = array
+(
+    # api文档生成是否开启,开启后,将会根据访问来生成文档。生产环境建议禁止
+    'apiDoc' => false,
+    # api日志是否开启,开启后,将会记录所有带有_api后缀方法的请求参数和响应参数
+    'apiLog' => false,
+
+    # 定义自动转为api的目录,可以将该目录下的所有类的公共方法,都转为可以访问的api,开启该功能可能有安全性问题。
+    'apiOpenPath' => 'src',
+
+    # 启用后,将会根据api目录下的配置文件自动定位api
+    'apiConfig' => false,
+);
+
+if (isset($dc['data'])) {
+    $config['base']['data'] = $dc['data'];
+}
+
+$create = -1;
+if (isset($dc['mysql']['create'])) {
+    $create = -1;
+}
+$ip = isset($dc['host']) ? $dc['host'] : '192.168.33.10';
+
+$local = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $ip;
+
+
+# 数据库配置
+$config['database'] = array
+(
+    # 是否开启mysql自助优化功能,开启后,会记录所有where条件和order的字段,可以方便的在后台进行分析、增加索引,必须安装manage组件
+    //'opt' => true,
+
+    # 是否开启sql自动优化,将sql中的select * 转换为 select a,b形式,将sql中的where条件按照索引从左到右自动排序,必须打开上述的opt选项,数据量大时建议打开。
+    //'sqlOp' => true,
+    'create' => $create,
+	# 默认数据库配置
+	'default' => array
+	(
+		'type' => 'pdo',
+		'host' => array
+		(
+			'read' => isset($dc['mysql']) ? $dc['mysql']['host'] : 'web-mysql:3306',
+			'update' => isset($dc['mysql']) ? $dc['mysql']['host'] : 'web-mysql:3306',
+            'create' => isset($dc['mysql']) ? $dc['mysql']['host_create'] : 'web-mysql:3306',
+		),
+		'database' => 'churen',
+		'username' => isset($dc['mysql']) ? $dc['mysql']['username'] : 'root',
+		'password' => isset($dc['mysql']) ? $dc['mysql']['password'] : '123456',
+		'charset' => 'utf8mb4',
+	),
+);
+
+# 缓存配置
+$config['cache'] = array
+(
+    # 启用mysql数据库缓存,这个缓存是根据表名自动生成,dever::load形式和service的all、one形式均自动支持,无需手动添加
+    'mysql' => 0,
+    # 启用页面缓存 会根据当前的url来生成缓存,相当于页面静态化。
+    'html' => 0,
+    # 启用数据级别缓存 这个缓存是程序员自定义的:Dever::cache('name', 'value', 3600);
+    'data' => 0,
+    # 启用load加载器缓存,一般不加载
+    'load' => 0,
+    # 启用load加载器的远程加载缓存
+    'curl' => 0,
+    # 启用路由缓存
+    'route' => 0,
+
+    # 缓存精细控制,根据uri来控制,0则无需缓存
+    'routeKey' => array
+    (
+        
+    ),
+
+    # 哪些路由中的参数不参与生成缓存的key
+    'routeNoParam' => array
+    (
+        'uid' => array
+        (
+            
+        ),
+    ),
+    
+    # 缓存清理的参数名,请通过shell=clearcache执行
+    'shell' => 'clearcache',
+
+    # 是否启用key失效时间记录,启用之后,将会记录每个key的失效时间
+    'expire' => true,
+
+    # 缓存类型
+    'type' => 'redis',//memcache、redis
+
+    # 缓存保存方式,支持多个数据源、多台缓存服务器
+    'store' => array
+    (
+        array
+        (
+            'host' => 'server-redis',
+            'port' => '6379',
+            'weight' => 100,
+            'password' => 'dm_redis_123',
+        ),
+    ),
+);
+
+$config['debug'] = array
+(
+	'log' => false
+);
+
+/*
+if (DEVER_APP_NAME == 'source') {
+    $config['debug']['log'] = array('type' => 'file'); 
+}
+*/
+
+
+$host = 'http://'.$local . '/';
+
+$upload = $host . 'churen/package/';
+$uploadcdn = $host . 'churen/data/';
+
+$config['host'] = array
+(
+    'upload'=> $upload . 'upload/?save',
+    'uploadRes'     => isset($dc['res']) && $dc['res'] ? $dc['res'] : $uploadcdn . 'upload/',
+
+    # 定义接口
+    'project' => array
+    (
+        'uploads' => array
+        (
+            'path' => $host. 'churen/package/upload/?',
+        ),
+    ),
+);
+
+/*
+if (!strstr($_SERVER['DOCUMENT_URI'], 'goods')) {
+    //$config['host']['project']['goods'] = $config['host']['project']['goodss'];
+}
+*/
+
+return $config;

+ 6 - 0
config/route.php

@@ -0,0 +1,6 @@
+<?php
+return array
+(
+	'home' => 'home',
+	'c=v(.*?)_(.*?)' => 'view.get?type=$1&id=$2',
+);

+ 1 - 0
data/readme

@@ -0,0 +1 @@
+dever create

+ 108 - 0
main/database/cate.php

@@ -0,0 +1,108 @@
+<?php
+# 获取分类权限
+$status = Dever::config('base')->status;
+
+return array
+(
+    # 表名
+    'name' => 'cate',
+    # 显示给用户看的名称
+    'lang' => '按钮分类',
+    # 后台菜单排序
+    'order' => 99,
+    # 数据结构
+    '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,
+        ),
+
+        'status'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '上线状态',
+            'default'   => '1',
+            'desc'      => '上线状态',
+            'match'     => 'is_numeric',
+            //'update'  => 'select',
+            'option'    => $status,
+            'search'    => 'select',
+            'list'      => true,
+            'edit'      => true,
+        ),
+
+        '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,
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    # 默认值
+    'default' => array
+    (
+        'col' => 'name,reorder,state,cdate',
+        'value' => array
+        (
+            '"工具箱",1,1,' . time(),
+        ),
+    ),
+
+    'manage' => array
+    (
+        
+    ),
+
+    'request' => array
+    (
+        
+    ),
+);

+ 159 - 0
main/database/config.php

@@ -0,0 +1,159 @@
+<?php
+
+$home_top_type = array
+(
+	1 => '显示',
+	2 => '不显示',
+);
+
+return array
+(
+	# 表名
+	'name' => 'config',
+	# 显示给用户看的名称
+	'lang' => '基本配置',
+	'order' => 1,
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '系统ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+		),
+		
+		'hr1'		=> array
+		(
+			'name' 		=> '通用设置',
+			'class'		=> '',//本项必须填写
+			'attr'		=> '',
+		),
+		
+		
+		'name'		=> array
+		(
+			'type' 		=> 'varchar-32',
+			'name' 		=> '系统名称',
+			'default' 	=> '',
+			'desc' 		=> '请输入系统名称',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+		),
+		
+		'info'		=> array
+		(
+			'type' 		=> 'varchar-1000',
+			'name' 		=> '系统描述',
+			'default' 	=> '',
+			'desc' 		=> '请输入系统描述',
+			'match' 	=> 'option',
+			'update'	=> 'textarea',
+		),
+
+		'logo'		=> array
+		(
+			'type' 		=> 'varchar-150',
+			'name' 		=> '系统LOGO',
+			'default' 	=> '',
+			'desc' 		=> '系统LOGO',
+			'match' 	=> 'option',
+			'update'	=> 'image',
+			'key' 		=> '1',
+			'place'		=> '150',
+		),
+
+		'home_top'		=> array
+		(
+			'type' 		=> 'varchar-150',
+			'name' 		=> '首页顶部图片',
+			'default' 	=> '',
+			'desc' 		=> '首页顶部图片',
+			'match' 	=> 'option',
+			'update'	=> 'image',
+			'key' 		=> '1',
+			'place'		=> '690*228',
+		),
+
+		'home_top_type'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '首页顶部图片显示文字',
+            'default'   => '1',
+            'desc'      => '首页顶部图片显示文字',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $home_top_type,
+            'search'    => 'select',
+            //'list'        => true,
+        ),
+
+		'hr5'       => array
+        (
+            'name'      => '分享配置',
+            'class'     => '',//本项必须填写
+            'attr'      => '',
+        ),
+
+        'share_title'       => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '分享标题-{name}为当前系统名称,{username}为当前登录的用户名',
+            'default'   => '',
+            'desc'      => '分享标题',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
+        'share_pic'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '分享图片-图片尺寸570*570px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
+            'default'   => '',
+            'desc'      => '分享图片',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '1',
+            'place'     => '150',
+            //'upload'  => 'qiniu',
+            //'large'   => true,
+        ),
+
+        'share_content'     => array
+        (
+            'type'      => 'varchar-200',
+            'name'      => '分享内容',
+            'default'   => '',
+            'desc'      => '分享内容',
+            'match'     => 'option',
+            'update'    => 'textarea',
+        ),
+		
+		'cdate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '录入时间',
+			'match' 	=> array('is_numeric', time()),
+			'desc' 		=> '',
+			# 只有insert时才生效
+			'insert'	=> true,
+		),
+	),
+
+	'default' => array
+	(
+		'col' => 'name,info,cdate',
+		'value' => array
+		(
+			'"合小记","合小记",' . time(),
+		),
+	),
+
+	'manage' => array
+	(
+		# 后台管理不要列表页
+		'list' => 'update',
+	),
+);

+ 113 - 0
main/database/page.php

@@ -0,0 +1,113 @@
+<?php
+
+
+$config = array
+(
+    # 表名
+    'name' => 'page',
+    # 显示给用户看的名称
+    'lang' => '单页管理',
+    # 后台菜单排序
+    'order' => 2,
+    'check' => 'key',
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            //'search'    => 'order',
+            //'list'      => true,
+            'order'     => 'desc',
+        ),
+        
+        'name'      => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '标题',
+            'default'   => '',
+            'desc'      => '标题',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'key'      => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '标识',
+            'default'   => '',
+            'desc'      => '标识',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'content'      => array
+        (
+            'type'      => 'text-255',
+            'name'      => '内容',
+            'default'   => '',
+            'desc'      => '内容',
+            'match'     => 'is_string',
+            'update'    => 'editor',
+            //'list_name'		=> '链接',
+            //'list'      => 'Dever::load("content/lib/page.link", {id})',
+        ),
+
+        '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})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        
+    ),
+
+    'request' => array
+    (
+        
+    )
+);
+$auth = Dever::tops();
+
+if ($auth && $auth != 1) {
+    $config['request']['list'] = array
+    (
+        # 匹配的正则或函数 选填项
+        'option' => array
+        (
+            'name' => array('yes', 'like'),
+            'key' => array('_' . $auth, 'like'),
+        ),
+        'type' => 'all',
+        'order' => array('id' => 'desc'),
+        'page' => array(20, 'list'),
+        'col' => '*|id',
+    );
+}
+
+return $config;

+ 8 - 0
main/index.php

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

+ 16 - 0
main/lib/Core.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Main\Lib;
+
+use Dever;
+
+class Core
+{
+    protected $checkUser = false;
+    protected $data;
+    public function __construct()
+    {
+        # 获取用户信息
+        $this->user = Dever::load('passport/user')->init();
+    }
+}

+ 14 - 0
main/page/list.php

@@ -0,0 +1,14 @@
+<?php
+
+# 定义父节点的类型、属性等(整个page的节点)
+$html->parent = array('ul', '');
+# 定义子节点的类型、属性等(每个page的节点)
+$html->child = array('li', '');
+# 定义上一页的名称、样式
+$html->prev = array('上一页', 'pg-prev');
+# 定义下一页的名称、样式
+$html->next = array('下一页', 'pg-next');
+# 定义每个页数的样式,当前页的样式 样式写在哪 是否和旧样式共用
+$html->page = array('', 'active', 'parent');
+# 生成
+$html->create();

+ 22 - 0
main/src/Api.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace Main\Src;
+
+use Dever;
+use Main\Lib\Core;
+
+class Api
+{
+    # 基本配置
+    public function config()
+    {
+        $data = Dever::db('main/config')->one();
+
+        $result = array();
+        $result['system_name'] = $data['name'];
+        $result['system_info'] = $data['info'];
+        $result['system_logo'] = $data['logo'];
+
+        return $result;
+    }
+}

+ 33 - 0
main/src/View.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace Main\Src;
+
+use Dever;
+use Main\Lib\Core;
+
+class View extends Core
+{
+    # 获取单页详情
+    public function getPage()
+    {
+        $this->data['info'] = $this->page();
+
+        return $this->data;
+    }
+
+    # 获取单页详情
+    public function page()
+    {
+        $key = Dever::input('key');
+        if (!$key) {
+            Dever::alert('您访问的页面有误');
+        }
+
+        $info = Dever::db('main/page')->one(array('key' => $key . '_' . $this->data['system']));
+        if (!$info) {
+            $info = Dever::db('main/page')->one(array('key' => $key));
+        }
+
+        return $info;
+    }
+}

+ 3 - 0
package.json

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

+ 4 - 0
package/alibaba/index.php

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

+ 4 - 0
package/aliyun/index.php

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

+ 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');

+ 4 - 0
package/article/index.php

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

+ 4 - 0
package/attr/index.php

@@ -0,0 +1,4 @@
+<?php 
+define('DEVER_PACKAGE', 'attr');
+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/category/index.php

@@ -0,0 +1,4 @@
+<?php 
+define('DEVER_PACKAGE', 'category');
+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;

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

+ 1 - 0
package/sku/database/option.php

@@ -0,0 +1 @@
+option.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');