chuweiqiang 1 năm trước cách đây
mục cha
commit
5f29ab07a3

+ 11 - 0
app/admin/controller/ShopCoor.php

@@ -149,8 +149,19 @@ class ShopCoor extends Controller
             $data['latitude']=$merchant['latitude']??null;
 //            $data['amount']=min(array_column($item,'price'));
             $data['type'] =1;
+            if(!$data['offer_id']){
+                unset($data['offer_id']);
+            }
 //            $order= \app\data\model\ShopCoordination::create($data);
             $order=Model::update($data);
+            foreach ($item as &$v){
+                if(isset($v['enclosure'])){
+                    $v['enclosure'] = $v['enclosure'];
+                }else{
+                    $v['enclosure'] = [];
+                }
+            }
+
             $order->items()->saveAll($item);
             app()->db->commit();
             $this->success('保存成功');

+ 3 - 0
app/admin/controller/ShopOcean.php

@@ -163,6 +163,9 @@ class ShopOcean extends Controller
 //            $data['amount']=min(array_column($item,'price'));
             $data['type'] =1;
 //            $order= \app\data\model\ShopOcean::create($data);
+            if(!$data['offer_id']){
+                unset($data['offer_id']);
+            }
             $order=Model::update($data);
             $order->items()->saveAll($item);
             app()->db->commit();

+ 13 - 5
app/admin/controller/ShopProduction.php

@@ -160,6 +160,9 @@ class ShopProduction extends Controller
 //            print_r($data);
 //            exit();
             //$order= \app\data\model\ShopProduction::create($data);
+            if(!$data['offer_id']){
+                unset($data['offer_id']);
+            }
             $order=Model::update($data);
 //            $order->items()->saveAll($item);
             app()->db->commit();
@@ -167,13 +170,18 @@ class ShopProduction extends Controller
             $item_ids=[];
             foreach ($item as &$v){
                 $item_data = [
-                    'purchase_id'=>$data['id'],
+                    'production_id'=>$data['id'],
                     'name'=>$v['name'],
                     'spec'=>$v['spec'],
                     'number'=>$v['number'],
 //                    'standard'=>$v['standard'],
 //                    'price'=>$v['price'],
                 ];
+                if(isset($v['enclosure'])){
+                    $item_data['enclosure'] = $v['enclosure'];
+                }else{
+                    $item_data['enclosure'] = [];
+                }
                 if(!empty($v['id'])){
                     $itemModel=$order->items()->where('id',$v['id'])->find();
                     if(!$itemModel){
@@ -185,10 +193,10 @@ class ShopProduction extends Controller
                 }
                 $item_ids[]=$itemModel['id'];
             }
-            $order = $order->items()->whereNotIn('id',$item_ids)->select()->each(function ($d){$d->delete();});
-                ShopProductionOffer::where('order_id',$data['id'])
-                ->whereNotIn('item_id',$item_ids)
-                ->select()->each(function ($m){$m->delete();});
+//            $order = $order->items()->whereNotIn('id',$item_ids)->select()->each(function ($d){$d->delete();});
+//                ShopProductionOffer::where('order_id',$data['id'])
+//                ->whereNotIn('item_id',$item_ids)
+//                ->select()->each(function ($m){$m->delete();});
             $this->success('保存成功');
         }
     }

+ 3 - 0
app/admin/controller/ShopPurchase.php

@@ -130,6 +130,9 @@ class ShopPurchase extends Controller
             $data['latitude']=$merchant['latitude']??null;
             $data['amount']=min(array_column($item,'price'));
             $data['type'] =1;
+            if(!$data['offer_id']){
+                unset($data['offer_id']);
+            }
             $order=Model::update($data);
 //            $order->items()->saveAll($item);
             app()->db->commit();

+ 12 - 7
app/admin/view/shop_coor/index.html

@@ -58,6 +58,7 @@
                     <th>交货地址</th>
                     <th>交货时间</th>
                     <th>发布时间</th>
+                    <th>取消状态</th>
                     <th>操作面板</th>
                 </tr>
                 </thead>
@@ -89,13 +90,17 @@
                     <td class="nowrap">
                         {$vo.post_time}
                     </td>
-                    <!--                    <td class="nowrap">-->
-                    <!--                        {if $vo.amount == 0.00}-->
-                    <!--                        '未匹配'-->
-                    <!--                        {else}-->
-                    <!--                        {$vo.amount}-->
-                    <!--                        {/if}-->
-                    <!--                    </td>-->
+                    <td class="nowrap">
+                        {$vo.create_time}
+                    </td>
+
+                    <td class="nowrap">
+                        {if $vo.status == 0}
+                        已取消
+                        {else}
+                        未取消
+                        {/if}
+                    </td>
                     <td class="nowrap">
                         <div>
                             <a class="layui-btn layui-btn-primary layui-btn-sm" data-modal="{:url('detail')}?id={$vo.id}" data-area='["1200px","90%"]'>查看详情</a>

+ 8 - 1
app/admin/view/shop_ocean/index.html

@@ -60,6 +60,7 @@
                     <th>装货码头</th>
                     <th>到港码头</th>
                     <th>发布时间</th>
+                    <th>取消状态</th>
                     <th>操作面板</th>
                 </tr>
                 </thead>
@@ -104,7 +105,13 @@
                     <td class="nowrap">
                         {$vo.create_time}
                     </td>
-
+                    <td class="nowrap">
+                        {if $vo.status == 0}
+                        已取消
+                        {else}
+                        未取消
+                        {/if}
+                    </td>
                     <td class="nowrap">
                         <div>
                             <a class="layui-btn layui-btn-primary layui-btn-sm" data-modal="{:url('detail')}?id={$vo.id}" data-area='["1200px","90%"]'>查看详情</a>

+ 8 - 1
app/admin/view/shop_production/index.html

@@ -59,6 +59,7 @@
                     <th>交货时间</th>
 <!--                    <th>已报价价格</th>-->
                     <th>发布时间</th>
+                    <th>取消状态</th>
                     <th>操作面板</th>
                 </tr>
                 </thead>
@@ -100,7 +101,13 @@
                     <td class="nowrap">
                         {$vo.create_time}
                     </td>
-
+                    <td class="nowrap">
+                        {if $vo.status == 0}
+                        已取消
+                        {else}
+                        未取消
+                        {/if}
+                    </td>
                     <td class="nowrap">
                         <div>
                             <a class="layui-btn layui-btn-primary layui-btn-sm" data-modal="{:url('detail')}?id={$vo.id}" data-area='["1200px","90%"]'>查看详情</a>

+ 9 - 2
app/admin/view/shop_purchase/index.html

@@ -71,6 +71,7 @@
                 <th>交货时间</th>
                 <th>已报价价格</th>
                 <th>发布时间</th>
+                <th>取消状态</th>
                 <th>操作面板</th>
             </tr>
             </thead>
@@ -112,7 +113,13 @@
                 <td class="nowrap">
                     {$vo.create_time}
                 </td>
-
+                <td class="nowrap">
+                    {if $vo.status == 0}
+                    已取消
+                    {else}
+                    未取消
+                    {/if}
+                </td>
                 <td class="nowrap">
                     <div>
                         <a class="layui-btn layui-btn-primary layui-btn-sm" data-modal="{:url('detail')}?id={$vo.id}" data-area='["1200px","90%"]'>查看详情</a>
@@ -201,4 +208,4 @@
 <script type="text/html" id="toolbar">
     <a class="layui-btn layui-btn-primary layui-btn-sm" data-modal="{:url('detail')}?id={{d.id}}" data-area='["1200px","90%"]'>查看详情</a>
 </script>
-{/block}
+{/block}

+ 1 - 1
app/data/controller/api/business/Order.php

@@ -172,7 +172,7 @@ class Order  extends Controller
         $status =[7,8];
         $query = ShopOrder::mQuery()->like('order_name');
         $list = $query ->where('admin_id',$admin_id['id'])
-            ->whereIn('status',$status)->where('refund_del',1)->order('id desc')->page(true, false, false, 10);
+            ->whereIn('status',$status)->where('refund_del',1)->whereOr('refund_status',3)->order('id desc')->page(true, false, false, 10);
         foreach ($list['list'] as $k=>$v){
             $list['list'][$k]['goods_item']=ShopOrderItem::mk()->where('order_no',$list['list'][$k]['order_no'])->select();
             $list['list'][$k]['user_address']=ShopOrderSend::mk()->where('order_no',$list['list'][$k]['order_no'])->find();