|
@@ -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'];
|