Browse Source

一些功能

Kirin 4 years ago
parent
commit
ccccd33ecb

+ 4 - 33
app/admin/view/order/store_order/exchange_order.php

@@ -106,37 +106,12 @@
                     <table class="layui-hide" id="List" lay-filter="List"></table>
                     <!--订单-->
                     <script type="text/html" id="order_id">
-                        {{d.order_id}}<br/>
-                        <span style="color: {{d.color}};">{{d.pink_name}}</span><br/> 
-                        {{#  if(d.store_order == 1){ }}<span style="color: #8b0000;">[{{d._store_order}}]</span>{{# } }} 
-                        {{#  if(d.store_order == 0){ }}<span style="color: #18b566;">[{{d._store_order}}]</span>{{# } }} 
-                        {{#  if(d.is_del == 1){ }}<span style="color: {{d.color}};">用户已删除</span>{{# } }} 
+                        {{d.order_id}}
                     </script>
                     <!--用户信息-->
                     <script type="text/html" id="userinfo">
                         {{d.nickname==null ? '暂无信息':d.nickname}}/{{d.uid}}
                     </script>
-                    <!--分销员信息-->
-                    <script type="text/html" id="spread_uid">
-                        {{# if(d.spread_uid != 0){ }}
-                        <button class="btn-xs btn-outline" type="button"
-                                onclick="$eb.createModalFrame('推荐人信息','{:Url('order_spread_user')}?uid={{d.spread_uid}}',{w:600,h:400})">
-                            {{d.spread_nickname}}
-                        </button>
-                        {{# }else{ }}无{{# } }}
-                    </script>
-                    <!--支付状态-->
-                    <script type="text/html" id="paid">
-                        {{#  if(d.pay_type==1){ }}
-                        <p>{{d.pay_type_name}}</p>
-                        {{#  }else{ }}
-                        {{# if(d.pay_type_info!=undefined){ }}
-                        <p><span>线下支付</span></p>
-                        {{# }else{ }}
-                        <p>{{d.pay_type_name}}</p>
-                        {{# } }}
-                        {{# }; }}
-                    </script>
                     <!--订单状态-->
                     <script type="text/html" id="status">
                         {{d.status_name}}
@@ -553,18 +528,14 @@
             {type: 'checkbox'},
             {field: 'order_id', title: '订单号', sort: true, event: 'order_id', width: '11%', templet: '#order_id'},
             {field: 'nickname', title: '用户信息', templet: '#userinfo', width: '6%', align: 'center'},
+            {field: 'gift_nickname', title: '赠送用户信息', templet: '#giftuserinfo', width: '6%', align: 'center'},
             {field: 'store', title: '门店', width: '6%', align: 'center'},
-            {field: 'point', title: '自提点', width: '6%', align: 'center'},
-            {field: 'spread_uid', title: '推荐人信息', templet: '#spread_uid', width: '8%', align: 'center'},
             {field: 'info', title: '商品信息', templet: "#info", height: 'full-20'},
             {field: 'pay_price', title: '支付金额', width: '6%', align: 'center'},
             {field: 'deposit', title: '支付押金', width: '6%', align: 'center'},
             {field: 'deposit_back', title: '已退押金', width: '6%', align: 'center'},
-            {field: 'use_integral', title: '使用积分', width: '6%', align: 'center'},
-            {field: 'time_area', title: '送达时间', width: '10%', align: 'center'},
-            {field: 'paid', title: '支付状态', templet: '#paid', width: '6%', align: 'center'},
-            {field: 'status', title: '订单状态', templet: '#status', width: '6%', align: 'center'},
-            {field: 'add_time', title: '下单时间', width: '6%', sort: true, align: 'center'},
+            {field: 'status', title: '状态', templet: '#status', width: '6%', align: 'center'},
+            {field: 'add_time', title: '创建时间', width: '6%', sort: true, align: 'center'},
             {field: 'right', title: '操作', align: 'center', toolbar: '#act', width: '10%'},
         ];
     });

+ 14 - 0
app/models/store/StoreExchangeOrder.php

@@ -7,6 +7,7 @@
 
 namespace app\models\store;
 
+use app\models\user\User;
 use crmeb\basic\BaseModel;
 use crmeb\traits\ModelTrait;
 
@@ -51,6 +52,19 @@ class StoreExchangeOrder extends BaseModel
             $model = $model->order('a.id desc');
         }
         $data = ($data = $model->page((int)$where['page'], (int)$where['limit'])->select()) && count($data) ? $data->toArray() : [];
+        foreach ($data as &$v) {
+            $v['nickname'] = User::where('uid', $v['uid'])->value('nickname');
+            $v['status_name'] = $v['status'] == 1 ? "已使用" : "未使用";
+            $_info = StoreOrderCartInfo::where('cart_id', $v['cart_id'])->field('cart_info')->select();
+            $_info = count($_info) ? $_info->toArray() : [];
+            foreach ($_info as $k => $vv) {
+                $cart_info = json_decode($vv['cart_info'], true);
+                if (!isset($cart_info['productInfo'])) $cart_info['productInfo'] = [];
+                $_info[$k]['cart_info'] = $cart_info;
+                unset($cart_info);
+            }
+            $v['_info'] = $_info;
+        }
         $count = $model->count();
         return compact('data', 'count');
     }