dever 3 anos atrás
pai
commit
7fde4747cc
3 arquivos alterados com 371 adições e 2 exclusões
  1. 123 1
      app/store/database/goods.php
  2. 112 1
      app/store/database/info.php
  3. 136 0
      app/store/database/member.php

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

@@ -1 +1,123 @@
-goods.php
+<?php
+
+$role = array
+(
+    1 => '管理员',
+    2 => '配货员',
+    3 => '库存管理员',
+    4 => '财务',
+);
+
+$store = function()
+{
+    $array = array();
+    $info = Dever::db('store/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,
+        ),
+
+        'store_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '所属仓库',
+            'default'   => '',
+            'desc'      => '所属仓库',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $store,
+            'list'      => 'Dever::load("store/info-find#name", {store_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})';
+        ),
+
+        'num'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '库存数量',
+            'default'   => '0',
+            'desc'      => '请填写库存数量',
+            'match'     => 'option',
+            'search'    => 'order',
+            '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
+    (
+        
+    ),
+);

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

@@ -1 +1,112 @@
-index.php
+<?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/store/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,
+        ),
+
+        'store_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '所属仓库',
+            'default'   => '',
+            'desc'      => '所属仓库',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $store,
+            'list'      => 'Dever::load("store/info-find#name", {store_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
+    (
+        
+    ),
+);