dever 3 years ago
parent
commit
ee639fce8f

+ 27 - 0
service/agent/assets/manage/html/order_process.html

@@ -0,0 +1,27 @@
+
+<form class="layui-form form10" action="" target="f10" method="post">
+<iframe id="f10" name="f10" style="display:none;"></iframe>
+<div class="layui-form-item" id="show">
+    <table class="layui-table">
+      <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>
+</form>

+ 9 - 0
service/agent/database/order.php

@@ -343,6 +343,15 @@ return array
             'desc'      => '请选择状态',
             'match'     => 'is_numeric',
         ),
+
+        'fdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '完成时间',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'desc'      => '',
+        ),
         
         'cdate'     => array
         (

+ 39 - 3
service/agent/database/order_process.php

@@ -2,7 +2,18 @@
 
 $status = array
 (
-    1 => '正常',
+    1 => '初审',
+    2 => '终审',
+    3 => '权益发放',
+);
+
+$type = array
+(
+    1 => '支付已确认',
+    2 => '权益已确认发放',
+    3 => '分润已确认发放',
+    4 => '期权已确认发放',
+    5 => '代理合同已生成',
 );
 
 return array
@@ -45,11 +56,36 @@ return array
             'default'   => '1',
             'desc'      => '状态',
             'match'     => 'is_numeric',
-            //'update'  => 'select',
+            'update'  	=> 'radio',
             'option'    => $status,
             'search'    => 'select',
+            'control'	=> 'status',
+        ),
+
+        'desc'      => array
+        (
+            'type'      => 'varchar-400',
+            'name'      => '备注',
+            'default'   => '',
+            'desc'      => '备注',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
             'list'      => true,
-            'edit'      => true,
+            'show'		=> 'type=1,2',
+        ),
+
+        'type'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '权益发放情况',
+            'default'   => '1',
+            'desc'      => '权益发放情况',
+            'match'     => 'is_numeric',
+            'update'  	=> 'radio',
+            'option'    => $type,
+            'search'    => 'select',
+            'show'		=> 'type=3',
         ),
 
         'state'     => array

+ 300 - 0
service/agent/lib/Order.php

@@ -282,4 +282,304 @@ class Order
 
         return $data;
     }
+
+
+    # 展示订单详情
+    public function show()
+    {
+        $id = Dever::input('order_id');
+
+        $config = Dever::db('agent/order')->config['set'];
+
+        $info = Dever::db('agent/order')->one($id);
+
+        $process = Dever::db('agent/order_process')->getData($id);
+
+        $status = $config['status'][$info['status']];
+
+        $member = array();
+        if ($info['mid'] > 0) {
+            $member = Dever::db('agent/member')->find($info['mid']);
+        }
+        
+        $parent_member = array();
+        if ($info['parent_mid'] > 0) {
+            $parent_member = Dever::db('agent/member')->find($info['parent_mid']);
+        }
+
+        $cdate = date('Y-m-d H:i', $info['cdate']);
+
+        if ($info['fdate']) {
+            $fdate = date('Y-m-d H:i', $info['fdate']);
+        } else {
+            $fdate = '';
+        }
+
+        if (!$member) {
+            $user['username'] = '无';
+        }
+        if (!isset($user['truename'])) {
+            $user['truename'] = $user['username'];
+        }
+
+        if (!$info['coupon_cash']) {
+            $info['coupon_cash'] = 0;
+        }
+
+        if (!$info['kou_cash']) {
+            $info['kou_cash'] = 0;
+        }
+
+        if (!$info['ps_cash']) {
+            $info['ps_cash'] = 0;
+        }
+
+        if (!$info['wallet_cash']) {
+            $info['wallet_cash'] = 0;
+        }
+
+        if (!$info['card_code_cash']) {
+            $info['card_code_cash'] = 0;
+        }
+
+        if ($info['card_code_card']) {
+            $info['card_code_cash'] .= '('.$info['card_code_card'].')';
+        }
+
+        if ($tk && $tk['process'] == 1) {
+            $status = '申请' . $tk_status[$tk['status']];
+            $process = $tk_process[$tk['process']];
+            $process = '';
+        }
+
+        $time = array();
+        $time[] = array('下单时间', $cdate);
+
+        if ($opertime) {
+            if ($info['status'] == 2) {
+                $time[] = array('通知时间', $opertime);
+            }
+            if ($info['status'] == 7) {
+                $time[] = array('取消时间:', $opertime);
+            }
+        }
+
+        if ($fdate) {
+            $time[] = array('完成时间:', $fdate);
+        }
+
+        $result = array();
+
+        $result[$info['order_num']] = array
+        (
+            'type' => 'info',
+            'content' => array
+            (
+                array
+                (
+                    array('订单状态', $status),
+                    array('支付方式', $config['pay_method'][$info['pay_method']]),
+                    array('配送方式', $config['method'][$info['method']]),
+                ),
+                
+                array
+                (
+                    array('门店名称', $shop['name']),
+                    array('联系人', $shop['truename']),
+                    array('联系电话', $shop['mobile']),
+                ),
+
+                array
+                (
+                    array('下单用户', $user['username']),
+                    array('联系电话', $info['mobile']),
+                    array('订单备注', $info['info']),
+                ),
+
+                array
+                (
+                    array('支付金额', '¥ ' . round($info['price'], 2)),
+                    array('优惠券满减', '¥ ' . $info['coupon_cash']),
+                    array('配送费', '¥ ' . $info['ps_cash']),
+                ),
+
+                array
+                (
+                    array('礼品卡抵扣', '¥ ' . round($info['card_code_cash'], 2)),
+                    array('钱包抵扣', '¥ ' . round($info['wallet_cash'], 2)),
+                    array('抹零', '¥ ' . round($info['kou_cash'], 2)),
+                ),
+
+                $time,
+            )
+        );
+
+        if ($info['address_id'] > 0) {
+            $address = Dever::load('passport/address')->getOne($info['uid'], $info['address_id']);
+
+            if ($address) {
+
+                $result['收货地址'] = array
+                (
+                    'type' => 'info',
+                    'content' => array
+                    (
+                        array
+                        (
+                            array('联系人', $address['contact']),
+                            array('联系电话', $address['mobile']),
+                        ),
+
+                        array
+                        (
+                            array('收货地址', $address['address']),
+                            array('门牌号', $address['house_number']),
+                        ),
+                    ),
+                );
+            }
+        }
+
+        
+        if ($info['invoice_id'] > 0) {
+            $invoice = Dever::load('passport/invoice')->getOne($info['uid'], $info['invoice_id']);
+
+            if ($invoice) {
+
+                $result['发票信息'] = array
+                (
+                    'type' => 'info',
+                    'content' => array
+                    (
+                        array
+                        (
+                            array('发票类型', $invoice['title_type_name']),
+                            array('抬头', $invoice['title']),
+                            array('税号', $invoice['number']),
+                        ),
+
+                        array
+                        (
+                            array('手机号', $invoice['mobile']),
+                            array('邮箱', $invoice['email']),
+                        ),
+                    ),
+                );
+            }
+        }
+
+
+        if (!$info['refund_cash']) {
+            $info['refund_cash'] = 0;
+        }
+
+        if ($info['refund_cash'] > 0 && $tk) {
+            $process = $tk_process[$tk['process']];
+            $tk['cdate'] = date('Y-m-d H:i', $tk['cdate']);
+            $result['退款信息'] = array
+            (
+                'type' => 'info',
+                'content' => array
+                (
+                    array
+                    (
+                        array('退款金额', $info['refund_cash']),
+                        array('数量', $info['num']),
+                        array('退款进度', $process),
+                    ),
+
+                    array
+                    (
+                        array('申请时间', $tk['cdate']),
+                        array('退款原因', $tk['desc']),
+                    ),
+                ),
+            );
+        }
+
+        $body = $refund_body = array();
+        $body_total = array();
+        $body_total['price'] = 0;
+        $body_total['num'] = 0;
+
+        $refund_body_total = array();
+        $refund_body_total['price'] = 0;
+        $refund_body_total['num'] = 0;
+
+        $goods = Dever::db('shop/sell_order_goods')->select(array('order_id' => $info['id']));
+        $goods_status = Dever::db('shop/sell_order_goods')->config['status'];
+
+        foreach ($goods as $k => $v) {
+            $goods_info = Dever::load('goods/lib/info')->getInfoBySku($v['goods_id'], $v['sku_id']);
+            $status = $goods_status[$v['status']];
+            $tk = Dever::db('shop/sell_order_refund')->find(array('order_id' => $info['id'], 'order_goods_id' => $v['id'], 'type' => 2));
+            if ($tk && $tk['process'] == 1) {
+                $status = '申请' . $tk_status[$tk['status']];
+                //$status .= '&nbsp;&nbsp;[' . $tk_process[$tk['process']] . ']';
+            }
+            if (isset($goods_info['sku'])) {
+                $sku = $goods_info['sku']['string'];
+            } else {
+                $sku = '无';
+            }
+
+            $d = array
+            (
+                'pic' => $goods_info['cover'],
+                'name' => $goods_info['name'],
+                'sku' => $sku,
+                'price' => $v['price'],
+                'num' => $v['num'],
+                'status' => $status,
+            );
+
+            if ($tk && $v['status'] == 3) {
+                $d['status'] = $tk_status[$tk['status']];
+                $refund_body[] = $d;
+                $price = $v['price']*$v['num'];
+                $refund_body_total['price'] += $price;
+                $refund_body_total['num'] += $v['num'];
+            } else {
+                $body[] = $d;
+                $price = $v['price']*$v['num'];
+                $body_total['price'] += $price;
+                $body_total['num'] += $v['num'];
+            }
+        }
+
+        if ($body) {
+            if ($refund_body_total['price']) {
+                $body_total['set_price'] = $body_total['price'] - $refund_body_total['price'];
+            }
+            if ($refund_body_total['num']) {
+                $body_total['set_num'] = $body_total['num'] - $refund_body_total['num'];
+            }
+
+            $result['商品清单'] = array
+            (
+                'type' => 'list',
+                'content' => $body,
+                'total' => $body_total,
+            );
+        }
+
+        if ($refund_body) {
+            $result['退款商品'] = array
+            (
+                'type' => 'list',
+                'content' => $refund_body,
+                'total' => $refund_body_total,
+            );
+        }
+        
+
+        $head = array
+        (
+            'name' => '基本信息',
+            'btn' => array(),
+        );
+        $html = Dever::show($head, $result);
+
+        return $html;
+    }
 }

+ 5 - 0
service/agent/template/manage/order_process.php

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