瀏覽代碼

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

rabin 2 年之前
父節點
當前提交
12f01f99eb
共有 2 個文件被更改,包括 16 次插入7 次删除
  1. 1 1
      service/mail/database/area_entry.php
  2. 15 6
      service/mail/lib/Manage.php

+ 1 - 1
service/mail/database/area_entry.php

@@ -148,7 +148,7 @@ return array
     (
         // 'insert' => false,
         'delete' => false,
-        'edit' => false,
+        // 'edit' => false,
         // 'excel' => true,
     ),
 

+ 15 - 6
service/mail/lib/Manage.php

@@ -594,13 +594,19 @@ class Manage
         }
         return $money;
     }
-    public function ls($where){
-        // print_R($where);die;
+    public function ls($where,$type=false){
         $shop = Dever::db('mail/area_entry')->getNewAll($where);
         $data = array();
         $data['price'] = 0;
         foreach($shop as $k => $v){
-            $shop[$k]['shop'] = Dever::db('shop/info')->find(array('area'=>$where['area'],'id'=>$v['shop_id']));
+            if ($type == 1) {
+                $shop[$k]['shop'] = Dever::db('shop/info')->find(array('city'=>$where['city'],'id'=>$v['shop_id']));
+            } elseif ($type == 2) {
+                $shop[$k]['shop'] = Dever::db('shop/info')->find(array('county'=>$where['county'],'id'=>$v['shop_id']));
+            } elseif ($type == 3) {
+                $shop[$k]['shop'] = Dever::db('shop/info')->find(array('town'=>$where['town'],'id'=>$v['shop_id']));
+            }
+            
         }
         foreach($shop as $k => $v){
             if(!$v['shop']){
@@ -662,7 +668,8 @@ class Manage
                     $data[$k]['citys']['t_price'] = 0;
                 }
                 #零售店
-                $shop_area = $this->ls($where);
+                $shop_area = $this->ls($where,1);
+                // print_R($where);die;
                 $data[$k]['citys']['l_price'] =$shop_area['price'] * 0.01;
                 $data[$k]['citys']['l_num'] = $shop_area['num'];
                 $data[$k]['citys']['price'] = $data[$k]['citys']['price'] + $data[$k]['citys']['l_price'];
@@ -713,7 +720,8 @@ class Manage
                 }
 
                 #零售店
-                $shop_area = $this->ls($where);
+                $where['county'] = $v['county'];
+                $shop_area = $this->ls($where,2);
                 $data[$k]['countys']['l_price'] = $shop_area['price'] * 0.03;
                 $data[$k]['countys']['l_num'] = $shop_area['num'];
                 $data[$k]['countys']['price'] = $data[$k]['countys']['price'] + $data[$k]['countys']['l_price'];
@@ -764,7 +772,8 @@ class Manage
                 }
 
                 #零售店
-                $shop_area = $this->ls($where);
+                $where['town'] = $v['town'];
+                $shop_area = $this->ls($where,3);
                 $data[$k]['towns']['l_price'] =$shop_area['price'] * 0.05;
                 $data[$k]['towns']['l_num'] = $shop_area['num'];
                 $data[$k]['towns']['price'] = $data[$k]['towns']['price'] + $data[$k]['towns']['l_price'];