dever 3 年之前
父节点
当前提交
6e99c7116e

+ 1 - 1
app/factory/admin/Excel.php

@@ -126,7 +126,7 @@ class Excel extends Core
     {
         $header = array();
 
-        $header = array('序号', '申请人', '发货日期', '客户名称', '品名', '单位', '数量', '订单号', '收件人', '收件电话', '收件邮寄地址', '发货时间', '发件物流', '运单编号', '备注');
+        $header = array('序号', '申请人', '发货日期', '客户名称', '品名', '单位', '数量', '订单号', '收件人', '收件电话', '收件邮寄地址', '备注');
 
         $file = '纯米发货信息表';
 

+ 1 - 1
app/factory/admin/Order.php

@@ -87,7 +87,7 @@ class Order extends Core
                     $dao_date = date('Y-m-d H:i', $v['source_out_date']);
                 }
 
-        		$html .= '<tr><td><input type="checkbox" name="mul_where_id[]" class="checkbox-checkall-list" lay-ignore value="'.$v['id'].'"/></td><td>'.$v['order_num'].'</td><td>'.$v['operdate'].'</td><td>'.$v['type_info']['name'].'</td><td>'.$ps_date.'</td><td>'.$v['p_price'].'</td><td>'.$v['status_name'].'</td><td>'.$v['out_status_name'].'</td><td>'.$dao_date.'</td><td>'.$button.'</td></tr>';
+        		$html .= '<tr><td>'.$v['order_num'].'</td><td>'.$v['operdate'].'</td><td>'.$v['type_info']['name'].'</td><td>'.$ps_date.'</td><td>'.$v['p_price'].'</td><td>'.$v['status_name'].'</td><td>'.$v['out_status_name'].'</td><td>'.$dao_date.'</td><td>'.$button.'</td></tr>';
         	}
         }
         return $html;

+ 1 - 1
app/factory/assets/pc/html/order.html

@@ -43,7 +43,7 @@
         <div id="table_2" style="display:"> 
           <table class="table layui-table layui-table-body" id="table">
           <thead id="list-thead">
-              <tr><th data-priority="1"><input type="checkbox" class="checkbox-checkall" name="checkall" id="checkall" value="list" lay-ignore/></th><th data-priority="1">订单号</th><th data-priority="1">订货日期</th><th data-priority="1">订单收件人</th><th data-priority="1">发货日期</th><th data-priority="1">订单金额</th><th data-priority="1">订单状态</th><th data-priority="1">导出状态</th><th data-priority="1">导出时间</th><th data-priority="1" class="dever-manage">管理</th></tr>
+              <tr><th data-priority="1">订单号</th><th data-priority="1">订货日期</th><th data-priority="1">订单收件人</th><th data-priority="1">发货日期</th><th data-priority="1">订单金额</th><th data-priority="1">订单状态</th><th data-priority="1">导出状态</th><th data-priority="1">导出时间</th><th data-priority="1" class="dever-manage">管理</th></tr>
           </thead>
           <tbody id="list-tbody"><tr><td><input type="checkbox" name="mul_where_id[]" class="checkbox-checkall-list" lay-ignore value="1"/></td><td>河北仓库1(18710001234)</td><td>测试工厂(15810090845)</td><td>F202111095151925058966182</td><td>38</td><td>2</td><td>待收货确认</td><td><a href="javascript:;" onclick="fastEdit($(this), 'http://zsmatest.nongxiaohe.com/package/manage/?l=project/database/list&amp;project=shop&amp;search_option_type=2&amp;page_type=2&amp;table=buy_order_goods&amp;project=shop&amp;order_id=1&amp;page_type=1&amp;menu=shop&amp;menu_id=99&amp;search_option_state=1', '查看详情', '', 1, 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs">查看详情</button></a>&nbsp;&nbsp;</td></tr></tbody>
       </table>

+ 2 - 0
app/mshop/lib/Buy.php

@@ -831,6 +831,7 @@ class Buy
                 'name' => '打印货单',
             );
 
+            /*
             if ($info['type'] == 2 && $info['source_type'] != 2 && in_array($info['status'], array(5,6,8))) {
                 $button[] = array
                 (
@@ -839,6 +840,7 @@ class Buy
                     'name' => '导出货单',
                 );
             }
+            */
 
             if ($info['status'] == 3 && $info['type'] == 1) {
                 $button[] = array

+ 1 - 1
app/mshop/src/Data.php

@@ -100,7 +100,7 @@ class Data extends Core
 
         $info = Dever::db('shop/sell_order')->find(array('code' => $code, 'id' => $order_id));
 
-        Dever::load('shop/lib/sell')->finish($info, $this->shop_id);
+        return Dever::load('shop/lib/sell')->finish($info, $this->shop_id);
     }
 
     # 取消订单

+ 6 - 4
app/shop/database/buy_order.php

@@ -29,7 +29,9 @@ $audit = array
 $refund_status = array
 (
     1 => '未申请',
-    2 => '已申请',
+    2 => '申请中',
+    3 => '有退款',
+    4 => '已退款',
 );
 
 $parent_type = array
@@ -305,12 +307,12 @@ $struct = array
     'refund_status'        => array
     (
         'type'      => 'tinyint-1',
-        'name'      => '退款状态',
+        'name'      => '申请退款状态',
         'default'   => '1',
-        'desc'      => '退款状态',
+        'desc'      => '申请退款状态',
         'match'     => 'is_numeric',
         'option'    => $refund_status,
-        //'search'    => 'select',
+        'search'    => 'select',
         'list_name'   => '退款状态',
         'list_order' => 10,
     ),

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

@@ -9,7 +9,7 @@ $config = array
     'order' => 200,
     'menu' => false,
     'desc' => '1、当前库存是当前可售的库存,零售下单支付成功就会扣掉<br />
-2、占用库存是当前卖了多少,,零售下单支付成功就会扣掉<br />
+2、占用库存是当前卖了多少<br />
 3、总库存是总进货多少,采购下单整个订单完成才会增加<br />
 4、在途库存是当前有多少库存在运送中,采购下单整个订单完成才会增加',
     'end' => array

+ 8 - 5
app/shop/database/sell_order.php

@@ -59,7 +59,9 @@ $status_manage = array
 $refund_status = array
 (
     1 => '未申请',
-    2 => '已申请',
+    2 => '申请中',
+    3 => '有退款',
+    4 => '已退款',
 );
 
 $shop = function()
@@ -361,12 +363,12 @@ return array
         'refund_status'        => array
         (
             'type'      => 'tinyint-1',
-            'name'      => '申请退款类型',
+            'name'      => '申请退款状态',
             'default'   => '1',
-            'desc'      => '申请退款类型',
+            'desc'      => '申请退款状态',
             'match'     => 'is_numeric',
             'option'    => $refund_status,
-            //'search'    => 'select',
+            'search'    => 'select',
             'list'      => $search_option_shop_type == 2 ? 'Dever::load("shop/lib/manage.buyInfoRefundStatus", "{id}", "sell_order")' : false,
             'list_name'   => '退款状态',
             'list_order' => 18,
@@ -813,9 +815,10 @@ return array
             (
                 'start' => array('yes-cdate', '>='),
                 'end' => array('yes-cdate', '<='),
+                'state' => 1,
             ),
             'type' => 'all',
-            'col' => 'id,order_num',
+            'col' => 'id,order_num,mobile,shop_id',
         ),
 
         # 获取订单数量

+ 195 - 175
app/shop/database/user_buy_stat.php → app/shop/database/user_rank_stat.php

@@ -1,176 +1,196 @@
-<?php
-
-$config = array
-(
-    # 表名
-    'name' => 'user_buy_stat',
-    # 显示给用户看的名称
-    'lang' => '用户排名统计',
-    'order' => -1,
-
-    # 数据结构 不同的字段放这里
-    'struct' => array
-    (
-        'id'        => array
-        (
-            'type'      => 'int-11',
-            'name'      => 'ID',
-            'default'   => '',
-            'desc'      => '',
-            'match'     => 'is_numeric',
-            //'list'        => true,
-        ),
-
-        'day'     => array
-        (
-            'type'      => 'int-11',
-            'name'      => '日期',
-            'default'   => '',
-            'match'     => 'is_numeric',
-            'desc'      => '',
-            'search'    => 'sday',
-            'search_buttons' => array
-            (
-                'sum' => 'num,cash',
-                'option' => array(
-                    'day' => '按天',
-                    'week' => '按周',
-                    'month' => '按月',
-                ),
-                'group' => 'uid',
-            ),
-            'order'     => 'desc',
-            //'list'      => 'Dever::showDay("{day}")',
-        ),
-
-        'uid'      => array
-        (
-            'type'      => 'int-11',
-            'name'      => '用户名',
-            'default'   => '',
-            'desc'      => '用户名',
-            'match'     => 'is_numeric',
-            'search'    => 'select',
-            'update'    => 'hidden',
-            'search'    => 'hidden',
-            'search'    => array
-            (
-                'api' => 'passport/user-like',
-                'col' => 'username',
-                'result' => 'id',
-            ),
-            'list'      => 'Dever::load("passport/user-one#username", {uid})',
-        ),
-
-        'area'       => array
-        (
-            'type'      => 'varchar-500',
-            'name'      => '客户所在城市',
-            'default'   => '',
-            'desc'      => '客户所在城市',
-            'match'     => 'option',
-            'search'    => 'linkage',
-            'update'    => 'linkage',
-            'option'    => Dever::url('api.get', 'area'),
-            'list'      => 'Dever::load("area/api.string", "{area}")',
-        ),
-
-        'wechat'        => array
-        (
-            'type'      => 'varchar-100',
-            'name'      => '微信号',
-            'default'   => '0',
-            'desc'      => '微信号',
-            'match'     => 'is_string',
-            'list'      => true,
-        ),
-
-        'mobile'        => array
-        (
-            'type'      => 'varchar-32',
-            'name'      => '手机号',
-            'default'   => '0',
-            'desc'      => '手机号',
-            'match'     => 'is_string',
-            'list'      => true,
-        ),
-
-        'num'        => array
-        (
-            'type'      => 'int-11',
-            'name'      => '数量',
-            'default'   => '0',
-            'desc'      => '数量',
-            'match'     => 'is_numeric',
-            'search'    => 'order',
-            'list'      => true,
-        ),
-
-        'cash'        => array
-        (
-            'type'      => 'varchar-100',
-            'name'      => '金额',
-            'default'   => '0',
-            'desc'      => '金额',
-            'match'     => 'is_string',
-            '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
-    (
-        'insert' => false,
-        'edit' => false,
-        'delete' => false,
-        'num' => false,
-        'excel' => true,
-    ),
-
-    # request 请求接口定义
-    'request' => array
-    (
-        'list' => array
-        (
-            # 匹配的正则或函数 选填项
-            'option' => array
-            (
-                'uid' => 'yes',
-                'area' => array('yes', 'like'),
-                'wechat' => array('yes', 'like'),
-                'mobile' => array('yes', 'like'),
-                'start_day' => array('yes-day', '>='),
-                'end_day' => array('yes-day', '<='),
-                'state' => 1,
-            ),
-            'type' => 'all',
-            'order' => array('day' => 'desc', 'cdate' => 'desc'),
-            'page' => array(20, 'list'),
-            'group' => 'uid',
-            'col' => '*,sum(cash) as cash, sum(num) as num',
-        ),
-    ),
-);
-
+<?php
+
+$config = array
+(
+    # 表名
+    'name' => 'user_rank_stat',
+    # 显示给用户看的名称
+    'lang' => '用户排名统计',
+    'order' => -13,
+
+    # 数据结构 不同的字段放这里
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            //'list'        => true,
+        ),
+
+        'day'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '日期',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'desc'      => '',
+            'search'    => 'day',
+            'search_button' => array
+            (
+                'sum' => 'num,cash',
+                'option' => array(
+                    'day' => '按天',
+                    'week' => '按周',
+                    'month' => '按月',
+                ),
+                'group' => 'day',
+            ),
+            'order'     => 'desc',
+            'list'      => 'Dever::showDay("{day}")',
+        ),
+
+        'shop_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '门店名称',
+            'default'   => '',
+            'desc'      => '门店名称',
+            'match'     => 'is_numeric',
+            'search'    => 'select',
+            //'option'    => $shop,
+            'update'    => 'hidden',
+            'search'    => 'hidden',
+            'search'    => array
+            (
+                'api' => 'shop/info-like',
+                'col' => 'name',
+                'result' => 'id',
+            ),
+            'value'     => Dever::input('search_option_shop_id'),
+            //'list'      => 'Dever::load("shop/info-one#name", {shop_id})',
+        ),
+
+        'area'       => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '所在街道',
+            'default'   => '',
+            'desc'      => '所在街道',
+            'match'     => 'option',
+            'search'    => 'linkage',
+            'update'    => 'linkage',
+            'option'    => Dever::url('lib/area.get', 'shop'),
+            //'list'      => 'Dever::load("area/api.string", "{area}")',
+        ),
+
+        'mobile'      => array
+        (
+            'type'      => 'bigint-11',
+            'name'      => '客户手机号',
+            'default'   => '',
+            'desc'      => '客户手机号',
+            'match'     => 'is_numeric',
+            'list'      => true,
+        ),
+
+        'num'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '数量',
+            'default'   => '0',
+            'desc'      => '数量',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'list'      => true,
+        ),
+
+        'cash'        => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '金额',
+            'default'   => '0',
+            'desc'      => '金额',
+            'match'     => 'is_string',
+            'search'    => 'order',
+            'list'      => 'round({cash}, 2)',
+        ),
+
+        'hb'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '环比增长',
+            'default'   => '0',
+            'desc'      => '环比增长',
+            'match'     => 'option',
+            'update'    => 'text',
+            'list'      => 'Dever::load("shop/lib/manage.getUserRankHb", "{num}", "{time}")',
+        ),
+
+        '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,
+        'excel' => true,
+    ),
+
+    # request 请求接口定义
+    'request' => array
+    (
+        'list' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'shop_id' => 'yes',
+                'mobile' => 'yes',
+                'area' => array('yes', 'like'),
+                'start_day' => array('yes-day', '>='),
+                'end_day' => array('yes-day', '<='),
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('time' => 'desc', 'cdate' => 'desc'),
+            'page' => array(20, 'list'),
+            'group' => 'day',
+            'col' => '*,min(day) as time, sum(cash) as cash, sum(num) as num',
+        ),
+
+        'prev' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'day' => array('yes-day', '<'),
+                //'start_day' => array('yes-day', '>='),
+                //'end_day' => array('yes-day', '<='),
+                'state' => 1,
+            ),
+            'order' => array('time' => 'desc', 'id' => 'desc'),
+            'type' => 'one',
+            'col' => '*,min(day) as time, sum(cash) as cash, sum(num) as num',
+            'group' => 'day',
+            # 允许自定义以上配置
+            'config' => true,
+        ),
+    ),
+);
+
 return $config;

+ 74 - 22
app/shop/lib/Cron.php

@@ -6,6 +6,46 @@ use Dever;
 
 class Cron
 {
+    # 同步退款状态
+    public function refund_status_api()
+    {
+        $order = Dever::db('shop/sell_order')->select();
+
+        foreach ($order as $k => $v) {
+            if ($v['refund_cash'] > 0) {
+                if ($v['status'] == 6 || $v['status'] == 8) {
+                    $status = 4;
+                } else {
+                    $status = 3;
+                }
+            } elseif ($info['refund_status'] == 2) {
+                $status = 2;
+            } else {
+                $status = 1;
+            }
+
+            Dever::db('shop/sell_order')->update(array('where_id' => $v['id'], 'refund_status' => $status));
+        }
+
+        $order = Dever::db('shop/buy_order')->select();
+
+        foreach ($order as $k => $v) {
+            if ($v['refund_cash'] > 0) {
+                if ($v['status'] == 6 || $v['status'] == 8) {
+                    $status = 4;
+                } else {
+                    $status = 3;
+                }
+            } elseif ($info['refund_status'] == 2) {
+                $status = 2;
+            } else {
+                $status = 1;
+            }
+
+            Dever::db('shop/buy_order')->update(array('where_id' => $v['id'], 'refund_status' => $status));
+        }
+    }
+
     # 获取7天后完成的订单 准备分账
     public function yspay_api()
     {
@@ -431,13 +471,12 @@ class Cron
     }
 
     /**
-     * 门店数据统计
+     * 用户排名统计
      *
      * @return mixed
      */
-    public function user_buy_api()
+    public function user_rank_api()
     {
-        return;
         $num = Dever::input('num', 1);
         $start = Dever::input('start', date('Y-m-d', strtotime('-'.$num.' day')));
         $end = Dever::input('end', date('Y-m-d'));
@@ -446,39 +485,52 @@ class Cron
         $end = Dever::maketime($end . ' 23:59:59');
         $day = intval(($end - $start)/86400);
 
-        $user = Dever::db('passport/user')->select();
+        $w['start'] = $start;
+        $w['end'] = $end;
+        $data = Dever::db('shop/sell_order')->getAllByDate($w);
+        print_r($data);die;
+
+        if ($data) {
+            foreach ($data as $k => $v) {
+                
+            }
+        }
 
-        foreach ($user as $k => $v) {
+        $shop = Dever::db('shop/info')->select();
+
+        foreach ($shop as $k => $v) {
             $where = array();
             $where['status'] = '2,3,4,5,6';
-            $where['uid'] = $v['id'];
+            $where['shop_id'] = $v['id'];
             for($i=0; $i<=$day; $i++) {
                 $where['start'] = $start + 86400*$i;
                 $where['end'] = $start + 86400*$i + 86399;
                 $data = array();
                 $data['shop_id'] = $v['id'];
                 $data['day'] = $where['start'];
-                $info = Dever::db('shop/user_buy_stat')->find($data);
-                $total = Dever::db('shop/sell_order')->getUser($where);
-                $data['total'] = count($total);
-                foreach ($total as $k1 => $v1) {
-                    if ($v1['total'] <= 1) {
-                        unset($total[$k1]);
-                    }
-                }
-                $data['num'] = count($total);
-
-                $data['order_num'] = Dever::db('shop/sell_order')->getOrderNum($where);
+                $info = Dever::db('shop/shop_stat')->find($data);
+                $cash = Dever::db('shop/sell_order')->getCashNum($where);
+                $data['sell_cash'] = round($cash['total'], 2);
+                $data['sell_num'] = Dever::db('shop/sell_order')->getOrderNum($where);
                 
+                $where['type'] = 1;
+                $where['type_id'] = $v['id'];
+                $cash = Dever::db('shop/buy_order')->getCashNum($where);
+                $data['buy_cash'] = round($cash['total'], 2);
+                $data['buy_num'] = Dever::db('shop/buy_order')->getOrderNum($where);
+
+                $data['sl_num'] = 0;
 
-                $data['area'] = $v['area_id'];
-                $data['wechat'] = $v['wechat'];
-                $data['mobile'] = $v['mobile'];
+                $data['area'] = $v['area'];
+                $data['province'] = $v['province'];
+                $data['city'] = $v['city'];
+                $data['county'] = $v['county'];
+                $data['town'] = $v['town'];
                 if (!$info) {
-                    Dever::db('shop/user_buy_stat')->insert($data);
+                    Dever::db('shop/shop_stat')->insert($data);
                 } else {
                     $data['where_id'] = $info['id'];
-                    Dever::db('shop/user_buy_stat')->update($data);
+                    Dever::db('shop/shop_stat')->update($data);
                 }
             }
         }

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

@@ -66,6 +66,8 @@ class Manage
             } else {
                 return '有退款';
             }
+        } elseif ($info['refund_status'] == 2) {
+            return '已申请';
         } else {
             return '未申请';
         }
@@ -570,6 +572,32 @@ class Manage
         return $result;
     }
 
+    # 获取环比增长
+    public function getUserRankHb($num, $day)
+    {
+        $where = array('day' => $day);
+        $search = Dever::search_button();
+        if ($search) {
+            $where['config']['group'] = $search[0];
+            $where['config']['col'] = str_replace('|id', '', $search[1]);
+        }
+        if ($num < 0) {
+            $num = 0;
+        }
+        $prev = Dever::db('shop/user_rank_stat')->prev($where);
+        if ($prev && $num > 0 && $prev['num'] >= 0) {
+            $n = $prev['num'];
+            if ($n == 0) {
+                $n = 1;
+            }
+            $hb = round(($num-$prev['num'])/$n, 2)*100;
+        } else {
+            $hb = 0;
+        }
+
+        return $hb . '%';
+    }
+
     # 确认收货
     public function setSellOrderStatus_api()
     {

+ 25 - 2
app/shop/lib/Refund.php

@@ -275,7 +275,16 @@ class Refund
                 $update['refund_p_cash'] = $order['refund_p_cash'] - $info['p_cash'];
             }
             $update['where_id'] = $order['id'];
-            $update['refund_status'] = 1;
+            if ($update['refund_cash'] <= 0) {
+                $update['refund_status'] = 1;
+            } else {
+                $update['refund_status'] = 3;
+            }
+            # 检测是否还有别的退款申请
+            $refund_data = Dever::db($this->refund_table)->find(array('order_id' => $order['id'], 'status' => 1));
+            if ($refund_data) {
+                $update['refund_status'] = 2;
+            }
             
             $state = Dever::db($this->order_table)->update($update);
 
@@ -300,13 +309,23 @@ class Refund
                     if ($total <= 0) {
                         $update['operdate'] = time();
                         $update['status'] = 8;
+                        $update['refund_status'] = 4;
                     } elseif ($order['status'] == 5) {
                         $update['status'] = 6;
+                        $update['refund_status'] = 3;
+                    } else {
+                        $update['refund_status'] = 3;
+                    }
+
+                    if ($update['refund_status'] == 3) {
+                        $refund_data = Dever::db($this->refund_table)->find(array('order_id' => $order['id'], 'status' => 1));
+                        if ($refund_data) {
+                            $update['refund_status'] = 2;
+                        }
                     }
 
                     if ($update) {
                         $update['where_id'] = $order['id'];
-                        $update['refund_status'] = 1;
                         $state = Dever::db($this->order_table)->update($update);
                     }
 
@@ -343,6 +362,7 @@ class Refund
                     //$update['ps_cash'] = 0;
                 }
                 $update['status'] = 8;
+                $update['refund_status'] = 4;
                 $state = Dever::db($this->order_table)->update($update);
                 if ($state) {
                     Dever::db($this->goods_table)->updates(array('option_order_id' => $order['id'], 'option_status' => 2, 'set_status' => 3));
@@ -427,6 +447,9 @@ class Refund
         if (isset($data['pay_type']) && $data['pay_type'] > 1) {
             return;
         }
+        if (isset($data['parent_type']) && $data['parent_type'] > 1) {
+            return;
+        }
         $refund_cash = $info['cash'];
         $refund_order_id = $info['id'];
         # 退款到原支付账户 待处理

+ 1 - 1
app/store/admin/Factory_order.php

@@ -47,7 +47,7 @@ class Factory_order extends Core
                 $url = Dever::url('lib/buy.excel_one?type='.$v['type'].'&type_id='.$v['type_id'].'&id='.$v['id'], 'mshop');
 
                 if ($v['status'] == 5 || $v['status'] == 6 || $v['status'] == 8) {
-                    $button .= '&nbsp;&nbsp;<a href="'.$url.'"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs">导出</button></a>';
+                    //$button .= '&nbsp;&nbsp;<a href="'.$url.'"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs">导出</button></a>';
                 }
 
                 $v['out_status_name'] = $out_status[$v['out_status']];

+ 3 - 1
app/store/admin/Order.php

@@ -100,7 +100,9 @@ class Order extends Core
                     $dao_date = date('Y-m-d H:i', $v['source_out_date']);
                 }
 
-        		$html .= '<tr><td><input type="checkbox" name="mul_where_id[]" class="checkbox-checkall-list" lay-ignore value="'.$v['id'].'"/></td><td>'.$v['order_num'].'</td><td>'.$v['operdate'].'</td><td>'.$v['type_info']['name'].'</td><td>'.$ps_date.'</td><td>'.$v['num'].'</td><td>'.$v['status_name'].'</td><td>'.$v['out_status_name'].'</td><td>'.$dao_date.'</td><td>'.$button.'</td></tr>';
+        		//$html .= '<tr><td><input type="checkbox" name="mul_where_id[]" class="checkbox-checkall-list" lay-ignore value="'.$v['id'].'"/></td><td>'.$v['order_num'].'</td><td>'.$v['operdate'].'</td><td>'.$v['type_info']['name'].'</td><td>'.$ps_date.'</td><td>'.$v['num'].'</td><td>'.$v['status_name'].'</td><td>'.$v['out_status_name'].'</td><td>'.$dao_date.'</td><td>'.$button.'</td></tr>';
+
+                $html .= '<tr><td>'.$v['order_num'].'</td><td>'.$v['operdate'].'</td><td>'.$v['type_info']['name'].'</td><td>'.$ps_date.'</td><td>'.$v['num'].'</td><td>'.$v['status_name'].'</td><td>'.$v['out_status_name'].'</td><td>'.$dao_date.'</td><td>'.$button.'</td></tr>';
         	}
         }
         return $html;

+ 1 - 1
app/store/assets/pc/html/order.html

@@ -48,7 +48,7 @@
         <div id="table_2" style="display:"> 
           <table class="table layui-table layui-table-body" id="table">
           <thead id="list-thead">
-              <tr><th data-priority="1"><input type="checkbox" class="checkbox-checkall" name="checkall" id="checkall" value="list" lay-ignore/></th><th data-priority="1">订单号</th><th data-priority="1">订货日期</th><th data-priority="1">订单收件人</th><th data-priority="1">发货日期</th><th data-priority="1">数量</th><th data-priority="1">订单状态</th><th data-priority="1">导出状态</th><th data-priority="1">导出时间</th><th data-priority="1" class="dever-manage">管理</th></tr>
+              <tr><th data-priority="1">订单号</th><th data-priority="1">订货日期</th><th data-priority="1">订单收件人</th><th data-priority="1">发货日期</th><th data-priority="1">数量</th><th data-priority="1">订单状态</th><th data-priority="1">导出状态</th><th data-priority="1">导出时间</th><th data-priority="1" class="dever-manage">管理</th></tr>
           </thead>
           <tbody id="list-tbody"><tr><td><input type="checkbox" name="mul_where_id[]" class="checkbox-checkall-list" lay-ignore value="1"/></td><td>河北仓库1(18710001234)</td><td>测试仓库(15810090845)</td><td>F202111095151925058966182</td><td>38</td><td>2</td><td>待收货确认</td><td><a href="javascript:;" onclick="fastEdit($(this), 'http://zsmatest.nongxiaohe.com/package/manage/?l=project/database/list&amp;project=shop&amp;search_option_type=2&amp;page_type=2&amp;table=buy_order_goods&amp;project=shop&amp;order_id=1&amp;page_type=1&amp;menu=shop&amp;menu_id=99&amp;search_option_state=1', '查看详情', '', 1, 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs">查看详情</button></a>&nbsp;&nbsp;</td></tr></tbody>
       </table>

+ 1 - 1
app/store/database/goods_log.php

@@ -56,7 +56,7 @@ $config = array
             'desc'      => '商品编码',
             'match'     => 'option',
             # 读取另外表的关联方式
-            'sync'      => array('sku_id', 'id'),
+            'sync'      => array('sku_id', 'id', 'goods_id', 'info_id', 'key'),
             'list'      => true,
             'list_order' => 2,
         ),

+ 2 - 2
app/store/database/goods_sku.php

@@ -8,7 +8,7 @@ $button = array
 );
 $list_button = array
 (
-    'list' => array('查看详情', '"goods_log&search_option_sid={id}&oper_table=goods_sku&top_table=info"'),
+    'list' => array('查看详情', '"goods_log&search_option_sid={id}&search_option_store_id={store_id}&oper_table=goods_sku&top_table=info"'),
     'fast_list' => array('库存设置', '"info_sku&project=goods&goods_id={goods_id}&other=store&other_id={store_id}&page_type=1"'),
 );
 if ($type != 1) {
@@ -16,7 +16,7 @@ if ($type != 1) {
     unset($button['导出调整明细']);
     unset($list_button['fast_list']);
 
-    $list_button['list'] = array('查看详情', '"goods_log&search_option_sid={id}&oper_table=goods_sku"');
+    $list_button['list'] = array('查看详情', '"goods_log&search_option_sid={id}&search_option_store_id={store_id}&oper_table=goods_sku"');
 }
 $config = array
 (