dever 4 سال پیش
والد
کامیت
77624ed185

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

@@ -1,113 +0,0 @@
-<?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' => '生产能力',
-    'order' => 10,
-    # 数据结构
-    '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
-    (
-        
-    ),
-);

+ 211 - 15
app/factory/database/info.php

@@ -2,8 +2,9 @@
 # 获取分类权限
 $status = array
 (
-    1 => '合作中',
-    2 => '已终止合作',
+    1 => '已认证',
+    2 => '认证中',
+    3 => '认证失败',
 );
 
 return array
@@ -28,6 +29,31 @@ return array
             'list'      => true,
             'order'     => 'desc',
         ),
+
+        'hr1'       => array
+        (
+            'name'      => '工厂基本信息',
+            'class'     => '',//本项必须填写
+            'attr'      => '',
+        ),
+
+        'uid'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '用户名',
+            'default'   => '0',
+            'desc'      => '请选择用户',
+            'match'     => 'is_numeric',
+            //'update'    => 'text',
+            //'search'  => 'select',
+            'searchs'    => array
+            (
+                'api' => 'passport/user-select',
+                'col' => 'username',
+                'result' => 'id',
+            ),
+            //'list'      => '{uid} > 0 ? Dever::load("passport/user-find#username", {uid}) : "匿名用户"',
+        ),
         
         'name'      => array
         (
@@ -41,14 +67,190 @@ return array
             'list'      => true,
         ),
 
+        'truename'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '联系人姓名',
+            'default'   => '',
+            'desc'      => '请输入联系人姓名',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'mobile'      => array
+        (
+            'type'      => 'bigint-11',
+            'name'      => '联系人电话',
+            'default'   => '',
+            'desc'      => '请输入联系人电话',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'area'       => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '所在城市',
+            'default'   => '',
+            'desc'      => '所在城市',
+            'match'     => 'option',
+            'search'    => 'linkage',
+            'update'    => 'linkage',
+            'option'    => Dever::url('api.get?level_total=2', 'area'),
+            'list'      => 'Dever::load("area/api.string", "{area}")',
+        ),
+
+        'province'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '省份',
+            'default'   => '',
+            'desc'      => '省份',
+            'match'     => 'option',
+            //'update'  => 'text',
+        ),
+
+        'city'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '城市',
+            'default'   => '',
+            'desc'      => '城市',
+            'match'     => 'option',
+            //'update'  => 'text',
+        ),
+
+        'map'       => array
+        (
+            'type'      => 'varchar-300',
+            'name'      => '地理位置',
+            'default'   => '',
+            'desc'      => '地理位置',
+            'match'     => 'is_string',
+            # 如果是map,必须在config的base.php中设置map信息
+            'update'  => 'map',
+        ),
+
+        'lng'       => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '经度',
+            'default'   => '',
+            'desc'      => '经度',
+            'match'     => 'option',
+            //'update'    => 'text',
+            //'list'        => true,
+        ),
+
+        'lat'       => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '纬度',
+            'default'   => '',
+            'desc'      => '纬度',
+            'match'     => 'option',
+            //'update'    => 'text',
+            //'list'        => true,
+        ),
+
+        'address'       => array
+        (
+            'type'      => 'varchar-1000',
+            'name'      => '工厂地址',
+            'default'   => '',
+            'desc'      => '工厂地址',
+            'match'     => 'option',
+            'update'    => 'text',
+            //'list'        => true,
+        ),
+
+        'hr2'       => array
+        (
+            'name'      => '工厂认证信息',
+            'class'     => '',//本项必须填写
+            'attr'      => '',
+        ),
+
+        'license'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '营业执照',
+            'default'   => '',
+            'desc'      => '营业执照',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '1',
+            'place'     => '660*660',
+        ),
+
+        'license_number'      => array
+        (
+            'type'      => 'varchar-200',
+            'name'      => '营业执照号码',
+            'default'   => '',
+            'desc'      => '营业执照号码',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
+        'company_name'      => array
+        (
+            'type'      => 'varchar-200',
+            'name'      => '公司名称',
+            'default'   => '',
+            'desc'      => '公司名称',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
+        'idcard_front'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '身份证正面',
+            'default'   => '',
+            'desc'      => '身份证正面',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '1',
+            'place'     => '660*660',
+        ),
+
+        'idcard_back'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '身份证背面',
+            'default'   => '',
+            'desc'      => '身份证背面',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '1',
+            'place'     => '660*660',
+        ),
+
+        'kh_license'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '开户许可证',
+            'default'   => '',
+            'desc'      => '开户许可证',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '1',
+            'place'     => '660*660',
+        ),
+
         'status'        => array
         (
             'type'      => 'int-11',
-            'name'      => '合作状态',
+            'name'      => '认证状态',
             'default'   => '1',
-            'desc'      => '上线状态',
+            'desc'      => '认证状态',
             'match'     => 'is_numeric',
-            //'update'  => 'select',
+            'update'  => 'select',
             'option'    => $status,
             'search'    => 'select',
             'list'      => true,
@@ -90,21 +292,15 @@ return array
         ),
     ),
 
-    # 默认值
-    'default' => array
+    'manage' => array
     (
-        'col' => 'name,reorder,state,cdate',
-        'value' => array
+        'list_button' => array
         (
-            '"默认工厂",1,1,' . time(),
+            'list1' => array('账号管理', '"member&search_option_shop_id={id}&oper_table=info"'),
+            'list4' => array('订货单', '"order&search_option_shop_id={id}&oper_table=info"'),
         ),
     ),
 
-    'manage' => array
-    (
-        
-    ),
-
     'request' => array
     (
         

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

@@ -17,7 +17,7 @@ return array
     # 显示给用户看的名称
     'lang' => '订货单',
     'order' => 1,
-
+    'menu' => false,
     # 数据结构
     'struct' => array
     (

+ 1 - 1
app/goods/database/info.php

@@ -356,7 +356,7 @@ $config = 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'),
+            'list' => array('价格设置', '"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' => '删除',
         ),

+ 8 - 0
app/mshop/index.php

@@ -0,0 +1,8 @@
+<?php
+
+define('DEVER_APP_NAME', 'mshop');
+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-component');
+include(DEVER_APP_PATH . '../boot.php');

+ 24 - 0
app/mshop/src/Act.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace Mshop\Src;
+
+use Dever;
+
+class Act extends Core
+{
+    public function getInfo()
+    {
+        $this->data['user'] = $this->user;
+
+        # 获取拥有的优惠券数量
+        $this->data['coupon_num'] = Dever::db('shop/user_coupon')->total(array('uid' => $this->uid));
+
+        $this->data['card_num'] = Dever::db('goods/card_code')->total(array('uid' => $this->uid));
+
+        $this->data['score'] = Dever::load('score/lib/core')->getUserScore($this->uid);
+
+        $this->data['msg'] = Dever::load('message/lib/data')->num($this->uid);
+
+        return $this->data;
+    }
+}

+ 30 - 0
app/mshop/src/Core.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace Mshop\Src;
+
+use Dever;
+use Main\Lib\Core as Base;
+
+class Core extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+        $this->checkLogin();
+        $this->shop_id = Dever::input('shop_id');
+
+        if (!$this->shop_id) {
+            Dever::alert('请选择门店');
+        }
+
+        $this->shop = Dever::db('shop/info')->find($this->shop_id);
+
+        if (!$this->shop) {
+            Dever::alert('门店不存在');
+        }
+
+        if ($this->shop['status'] != 1) {
+            Dever::alert('门店不存在');
+        }
+    }
+}

+ 83 - 0
app/mshop/src/Main.php

@@ -0,0 +1,83 @@
+<?php
+
+namespace Mshop\Src;
+
+use Dever;
+
+class Main extends Core
+{
+    public function home()
+    {
+        $day = Dever::input('day');
+
+        if (!$day) {
+            $day = date('Y-m-d');
+        }
+
+        $where['start'] = Dever::maketime($day . ' 00:00:00');
+        $where['end'] = Dever::maketime($day . '59:59:59');
+        $where['shop_id'] = $this->shop_id;
+
+        $this->data['num_order'] = Dever::db('shop/sell_order')->getOrderNum($where);
+        $this->data['num_cash'] = Dever::db('shop/sell_order')->getCashNum($where);
+        $this->data['num_goods'] = Dever::db('shop/sell_order')->getGoodsNum($where);
+
+        return $this->data;
+    }
+
+    # 销售订单管理
+    public function sell_order()
+    {
+        $where['shop_id'] = $this->shop_id;
+
+        $day = Dever::input('day');
+
+        
+        $this->data = Dever::db('shop/sell_order')->page($where);
+
+        if ($this->data) {
+            $this->config = Dever::db('shop/sell_order')->config;
+            foreach ($this->data as $k => $v) {
+                $this->data[$k] = $this->order_info($v);
+            }
+        }
+
+        return $this->data;
+    }
+
+    # 获取订单详细信息
+    public function order_info($info, $type = 1)
+    {
+        $info['status_name'] = $this->config['status'][$info['status']];
+        $info['method_name'] = $this->config['method'][$info['method']];
+
+        if ($info['method'] == 1 && $info['status'] > 1) {
+
+        }
+        $info['goods'] = Dever::db('shop/sell_order_goods')->select(array('order_id' => $info['id']));
+        $info['shop'] = Dever::db('shop/info')->find($info['shop_id']);
+        $info['cdate'] = date('Y-m-d H:i', $info['cdate']);
+
+        if ($type == 2) {
+            foreach ($info['goods'] as $k => $v) {
+                $info['goods']['info'] = Dever::load('goods/lib/info')->getInfo($v['goods_id']);
+            }
+            if ($info['address_id']) {
+                $info['address'] = Dever::db('passport/address')->find($info['address_id']);
+            }
+
+            if ($info['invoice_id']) {
+                $info['invoice'] = Dever::db('passport/invoice')->find($info['invoice_id']);
+            }
+
+            if ($info['coupon_id']) {
+                $coupon = Dever::db('shop/user_coupon')->find($info['coupon_id']);
+                if ($coupon) {
+                    $info['coupon'] = Dever::db('goods/coupon')->find($coupon['coupon_id']);
+                }
+            }
+        }
+
+        return $info;
+    }
+}

+ 24 - 0
app/mshop/src/My.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace Mshop\Src;
+
+use Dever;
+
+class My extends Core
+{
+    public function getInfo()
+    {
+        $this->data['user'] = $this->user;
+
+        # 获取拥有的优惠券数量
+        $this->data['coupon_num'] = Dever::db('shop/user_coupon')->total(array('uid' => $this->uid));
+
+        $this->data['card_num'] = Dever::db('goods/card_code')->total(array('uid' => $this->uid));
+
+        $this->data['score'] = Dever::load('score/lib/core')->getUserScore($this->uid);
+
+        $this->data['msg'] = Dever::load('message/lib/data')->num($this->uid);
+
+        return $this->data;
+    }
+}

+ 44 - 0
app/shop/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>

+ 14 - 1
app/shop/database/goods.php

@@ -48,6 +48,15 @@ return array
             'list'      => 'Dever::load("goods/info-find#name", {goods_id})',
         ),
 
+        'price_type'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '价格类型',
+            'default'   => '1',
+            'desc'      => '价格类型',
+            'match'     => 'is_numeric',
+        ),
+
         'num'        => array
         (
             'type'      => 'int-11',
@@ -96,7 +105,11 @@ return array
 
     'manage' => array
     (
-        
+        # 列表里的按钮
+        'list_button' => array
+        (
+            'list' => array('多价库存设置', '"goods_sku&project=shop&search_option_shop_goods_id={id}&oper_parent=goods&oper_project=shop&oper_save_jump=goods&page_type=1"', '{price_type} == 2'),
+        ),
     ),
 
     'request' => array

+ 10 - 1
app/shop/database/goods_sku.php

@@ -42,6 +42,15 @@ $config = array
             'list'      => 'Dever::load("goods/info-find#name", {goods_id})',
         ),
 
+        'shop_goods_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '商品名称',
+            'default'   => '',
+            'desc'      => '商品名称',
+            'match'     => 'is_numeric',
+        ),
+
         'sku_id'      => array
         (
             'type'      => 'int-11',
@@ -120,7 +129,7 @@ $config = array
         # 自定义快捷新增和编辑
         'button' => array
         (
-            '自定义属性' => array('fast', 1, 'config&where_id=1'),
+            //'自定义属性' => array('fast', 1, 'config&where_id=1'),
         ),
     ),
 

+ 11 - 1
app/shop/database/info.php

@@ -266,6 +266,16 @@ return array
             'place'     => '660*660',
         ),
 
+        'license_number'      => array
+        (
+            'type'      => 'varchar-200',
+            'name'      => '营业执照号码',
+            'default'   => '',
+            'desc'      => '营业执照号码',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
         'company_name'      => array
         (
             'type'      => 'varchar-200',
@@ -411,7 +421,7 @@ return array
             'list1' => array('账号管理', '"member&search_option_shop_id={id}&oper_table=info"'),
             'list2' => array('打印机管理', '"print&search_option_shop_id={id}&oper_table=info"'),
             'list3' => array('销售订单', '"sell_order&search_option_shop_id={id}&oper_table=info"'),
-            'list4' => array('采购订单', '"buy_order&search_option_shop_id={id}&oper_table=info"'),
+            //'list4' => array('采购订单', '"buy_order&search_option_shop_id={id}&oper_table=info"'),
         ),
     ),
 

+ 43 - 7
app/shop/database/sell_order.php

@@ -11,7 +11,7 @@ $method = array
 $pay_method = array
 (
     1 => '平台结算',
-    2 => '门店现付',
+    2 => '门店代下单',
     3 => '礼品卡',
 );
 
@@ -537,23 +537,59 @@ return array
             # 匹配的正则或函数 选填项
             'where' => array
             (
-                'time' => array('yes-cdate', '<='),
+                'start' => array('yes-cdate', '>='),
+                'end' => array('yes-cdate', '<='),
             ),
             'type' => 'all',
             'col' => 'id,order_id',
         ),
 
-        'getNum' => array
+        # 获取订单数量
+        'getOrderNum' => array
         (
             # 匹配的正则或函数 选填项
             'option' => array
             (
-                'object_id' => 'yes',
-                'info_id' => 'yes',
+                'start' => array('yes-cdate', '>='),
+                'end' => array('yes-cdate', '<='),
+                'shop_id' => 'yes',
+                'status' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'count',
+            'col' => '*',
+        ),
+
+        # 获取总金额
+        'getCashNum' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'start' => array('yes-cdate', '>='),
+                'end' => array('yes-cdate', '<='),
+                'shop_id' => 'yes',
+                'status' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'count',
+            'col' => 'sum(price) as total',
+        ),
+
+        # 获取商品数量
+        'getGoodsNum' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'start' => array('yes-cdate', '>='),
+                'end' => array('yes-cdate', '<='),
+                'shop_id' => 'yes',
+                'status' => 'yes',
                 'state' => 1,
             ),
-            'type' => 'one',
-            'col' => 'sum(buy_num) as buy_num',
+            'type' => 'count',
+            'col' => 'sum(num) as total',
         ),
     ),
 );

+ 10 - 0
app/shop/lib/Cron.php

@@ -15,4 +15,14 @@ class Cron
     {
         
     }
+
+    /**
+     * 处理销售数据
+     *
+     * @return mixed
+     */
+    public function sell()
+    {
+        
+    }
 }

+ 102 - 0
app/shop/lib/Manage.php

@@ -33,4 +33,106 @@ class Manage
             Dever::db('shop/info')->update($update);
         }
     }
+
+    public function skuConfig()
+    {
+        $data['action'] = Dever::url('shop/lib/manage.skuUp');
+        $data['info_id'] = Dever::input('search_option_shop_goods_id');
+        return $data;
+    }
+
+    public function skuUp_api()
+    {
+        $shop_goods_id = Dever::input('info_id');
+        $key = Dever::input('key');
+        $num = Dever::input('num');
+
+        $shop_goods = Dever::db('shop/goods')->one($shop_goods_id);
+        if ($key) {
+            foreach ($key as $k => $v) {
+                if (isset($num[$k]) && $num[$k]) {
+                    $info = Dever::db('goods/info_sku')->one(array('key' => $v));
+                    $data = array();
+                    $data['shop_id'] = $shop_goods['shop_id'];
+                    $data['goods_id'] = $shop_goods['goods_id'];
+                    $data['shop_goods_id'] = $shop_goods_id;
+                    $data['sku_id'] = $info['id'];
+                    $shop_info = Dever::db('shop/goods_sku')->one($data);
+
+                    $data['num'] = $num[$k];
+                    if (!$shop_info) {
+                        Dever::db('shop/goods_sku')->insert($data);
+                    } else {
+                        $data['where_id'] = $info['id'];
+                        Dever::db('shop/goods_sku')->update($data);
+                    }
+                }
+            }
+        }
+
+        Dever::out('yes');
+    }
+
+    public function skuInput()
+    {
+        $id = Dever::input('search_option_shop_goods_id');
+
+        $shop_goods = Dever::db('shop/goods')->one($id);
+
+        $sku = Dever::db('goods/info_sku')->getData(array('info_id' => $shop_goods['goods_id']));
+
+        $info = Dever::db('goods/info')->one($shop_goods['goods_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 .= '</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);
+                    $f_price = $s_price = $price = $num = '';
+                    if (isset($sku[$key])) {
+                        $num = $sku[$key]['num'];
+                    }
+                    $body .= '<td width="30"><input type="text" class="layui-input" name="num['.$k.']"  value="'.$num.'"/></td>';
+
+                    $body .= '<input type="hidden" name="key['.$k.']" value="'.$key.'"/>';
+                    $body .= '</tr>';
+                }
+            }
+
+            $body .= '</tbody>';
+            
+            $html = $head . $body;
+        }
+
+        return $html;
+    }
 }

+ 2 - 2
app/shop/src/Buy.php

@@ -66,7 +66,7 @@ class Buy extends Core
         $where['uid'] = $this->uid;
         $where['shop_id'] = $this->shop_id;
         $where['goods_id'] = Dever::input('goods_id');
-        $where['sku_id'] = Dever::input('sku_id');
+        $where['sku_id'] = Dever::input('price_id');
         if (!$where['goods_id']) {
             Dever::alert('错误的商品');
         }
@@ -259,7 +259,7 @@ class Buy extends Core
             }
             $goods_id = explode(',', $goods_id);
 
-            $sku_id = Dever::input('sku_id');
+            $sku_id = Dever::input('price_id');
             if ($sku_id) {
                 $sku_id = explode(',', $sku_id);
             }

+ 3 - 0
app/shop/src/My.php

@@ -114,6 +114,8 @@ class My extends Core
                 $this->data[$k] = $this->order_info($v);
             }
         }
+
+        return $this->data;
     }
 
     # 查看订单详情
@@ -129,6 +131,7 @@ class My extends Core
         $this->config = Dever::db('shop/sell_order')->config;
         $this->data = $this->order_info($this->data, 2);
 
+        return $this->data;
     }
 
     # 获取订单详细信息

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

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

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

@@ -1,13 +1,5 @@
 <?php
 
-$role = array
-(
-    1 => '管理员',
-    2 => '配货员',
-    3 => '库存管理员',
-    4 => '财务',
-);
-
 $store = function()
 {
     $array = array();