فهرست منبع

Merge branch 'master' of ssh://git.dever.cc:10022/dever-product/churen

rabin 3 سال پیش
والد
کامیت
c67d29d26f
3فایلهای تغییر یافته به همراه33 افزوده شده و 1 حذف شده
  1. 2 1
      app/shop/database/sell_order.php
  2. 12 0
      app/shop/database/sell_order_goods.php
  3. 19 0
      app/shop/lib/Manage.php

+ 2 - 1
app/shop/database/sell_order.php

@@ -279,10 +279,11 @@ return array
         'address_id'      => array
         (
             'type'      => 'int-11',
-            'name'      => '送货地址',
+            'name'      => $search_option_shop_type == 1 ? false : '商品信息',#'送货地址',
             'default'   => '',
             'desc'      => '送货地址',
             'match'     => 'is_numeric',
+            'list'      => $search_option_shop_type == 1 ? false : 'Dever::load("shop/lib/manage.goods_list",{id})',
             //'list'      => 'Dever::load("passport/address-find#address", {address_id})';
         ),
 

+ 12 - 0
app/shop/database/sell_order_goods.php

@@ -262,5 +262,17 @@ return array
             'type' => 'one',
             'col' => 'sum(price) as total',
         ),
+
+        'getGoods' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'order_id' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'col' => 'id,goods_id',
+        ),
     ),
 );

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

@@ -672,4 +672,23 @@ class Manage
 
         return $data;
     }
+
+    public function goods_list($id){
+        $info = Dever::db('shop/sell_order')->find($id);
+        $res = array();
+        $goods = Dever::db('shop/sell_order_goods')->getGoods(array('order_id'=>$id));
+        foreach($goods as $k => $v){
+            $data[] = Dever::db('goods/info')->fetch('select `name` from churen_goods_info where id = '.$v['goods_id'].' and state =1');
+        }
+        foreach($data as $k => $v){
+            $res[] = $v['name'];
+        }
+        if (count($res) > 3){
+            $html = $res[0].'<br/>'.$res[1].'<br/>'.$res['2'].'……';
+        } else {
+             $html = implode('<br/>',$res);
+        }
+       
+        return $html;
+    }
 }