牟新芬 3 years ago
parent
commit
98ee0fa191
1 changed files with 15 additions and 3 deletions
  1. 15 3
      app/model/api/Order.php

+ 15 - 3
app/model/api/Order.php

@@ -18,9 +18,21 @@ class Order extends BaseModel
             $list[$k]['_time'] = date('Y-m-d H:i:s', $v['time']);
             $product = ProductAttrValue::alias('a')->join('product s', 'a.product_id=s.id')
                 ->where('a.product_id',$v['pro_id'])->where('a.unique',$v['unique'])->field('a.*,s.store_name')->find();
-            $list[$k]['store_name'] = $product['store_name'];
-            $list[$k]['image'] = $product['image'];
-            $list[$k]['suk'] = $product['suk'];
+            if(!empty($product['store_name'])) {
+                $list[$k]['store_name'] = $product['store_name'];
+            }else{
+                $list[$k]['store_name'] = '';
+            }
+            if(!empty($product['image'])) {
+                $list[$k]['image'] = $product['image'];
+            }else{
+                $list[$k]['image'] = '';
+            }
+            if(!empty($product['suk'])) {
+                $list[$k]['suk'] = $product['suk'];
+            }else{
+                $list[$k]['suk'] = '';
+            }
         }
         return $list;
     }