|
@@ -555,6 +555,13 @@ class Cron
|
|
$shop[$k]['out_money'][] = Dever::db('agent/order')->getVCount(array('mid'=>$v3['id'],'start'=>$v['cdate'][$k1],'end'=>$end,'role'=>8,'state'=>1));
|
|
$shop[$k]['out_money'][] = Dever::db('agent/order')->getVCount(array('mid'=>$v3['id'],'start'=>$v['cdate'][$k1],'end'=>$end,'role'=>8,'state'=>1));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ #创V名额内业绩
|
|
|
|
+ $nei = Dever::db('agent/member')->guidian(array('parent_mid'=>$v1,'start'=>$v['cdate'][$k1],'role'=>8,'prize_type'=>2));
|
|
|
|
+ if(isset($nei) && $nei){
|
|
|
|
+ foreach($nei as $v3){
|
|
|
|
+ $shop[$k]['nei_money'][] = Dever::db('agent/order')->getVCount(array('mid'=>$v3['id'],'start'=>$v['cdate'][$k1],'end'=>$end,'role'=>8,'state'=>1));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// }
|
|
// }
|
|
|
|
|
|
}
|
|
}
|
|
@@ -603,6 +610,13 @@ class Cron
|
|
}else{
|
|
}else{
|
|
$shop[$key]['out_money'] = 0;
|
|
$shop[$key]['out_money'] = 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ #创V名额内业绩
|
|
|
|
+ if(isset($val['nei_money']) && $val['nei_money']){
|
|
|
|
+ $shop[$key]['nei_money'] = array_sum(array_map(function($val){return $val['total'];}, $val['nei_money']));
|
|
|
|
+ }else{
|
|
|
|
+ $shop[$key]['nei_money'] = 0;
|
|
|
|
+ }
|
|
|
|
|
|
$insert['shop_id'] = $val['id'];
|
|
$insert['shop_id'] = $val['id'];
|
|
$insert['mids'] = $val['mids'];
|
|
$insert['mids'] = $val['mids'];
|
|
@@ -616,6 +630,7 @@ class Cron
|
|
$insert['month'] = $start;
|
|
$insert['month'] = $start;
|
|
$insert['out_num'] = $val['out_num'];
|
|
$insert['out_num'] = $val['out_num'];
|
|
$insert['out_money'] = $shop[$key]['out_money'];
|
|
$insert['out_money'] = $shop[$key]['out_money'];
|
|
|
|
+ $insert['nei_money'] = $shop[$key]['nei_money'];
|
|
|
|
|
|
if($insert){
|
|
if($insert){
|
|
$res = Dever::db('bill/shop_stat')->getState(array('start'=>$start,'end'=>$end,'shop_id'=>$insert['shop_id'],'state'=>1));
|
|
$res = Dever::db('bill/shop_stat')->getState(array('start'=>$start,'end'=>$end,'shop_id'=>$insert['shop_id'],'state'=>1));
|