|
@@ -377,20 +377,27 @@ class Manage
|
|
|
$rest = array();
|
|
|
$rest['start'] = date('Y-m-d',$start);
|
|
|
$rest['end'] = date('Y-m-d',$end);
|
|
|
+ $rest['data'] = array();
|
|
|
$data = Dever::db('agent/order')->getAll($where);
|
|
|
- foreach($data as $k => $v){
|
|
|
- #单独购买的软件服务费
|
|
|
- $cash = Dever::db('agent/soft_cash')->getTotal(array('fstart'=>$start,'fend'=>$end,'mid'=>$v['mid']));
|
|
|
- $data[$k]['buy_cash'] = $cash['total'];
|
|
|
- $option = Dever::db('agent/soft_cash')->getPrice(array('fstart'=>$start,'fend'=>$end,'mid'=>$v['mid']));
|
|
|
- $data[$k]['y_price'] = $option['total'];
|
|
|
- }
|
|
|
- $rest['data'] = $data;
|
|
|
- if($type == 1){
|
|
|
- return $rest['data'];
|
|
|
+ if($data){
|
|
|
+ foreach($data as $k => $v){
|
|
|
+ #单独购买的软件服务费
|
|
|
+ $cash = Dever::db('agent/soft_cash')->getTotal(array('fstart'=>$start,'fend'=>$end,'mid'=>$v['mid']));
|
|
|
+ $data[$k]['buy_cash'] = $cash['total'];
|
|
|
+ $option = Dever::db('agent/soft_cash')->getPrice(array('fstart'=>$start,'fend'=>$end,'mid'=>$v['mid']));
|
|
|
+ $data[$k]['y_price'] = $option['total'];
|
|
|
+ }
|
|
|
+ $rest['data'] = $data;
|
|
|
+ if($type == 1){
|
|
|
+ return $rest['data'];
|
|
|
+ }else{
|
|
|
+ return Dever::render('option_nopay', $rest);
|
|
|
+ }
|
|
|
}else{
|
|
|
return Dever::render('option_nopay', $rest);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
#代理商期权待交付导出
|
|
|
public function out_option_nopay_api(){
|
|
@@ -487,47 +494,80 @@ class Manage
|
|
|
Dever::excelExport($body, $header, $file);
|
|
|
}
|
|
|
}
|
|
|
- // #城市数据统计
|
|
|
- // public function city_api(){
|
|
|
- // // $provice = Dever::input('provice');
|
|
|
- // // $city = Dever::input('city');
|
|
|
- // $area = Dever::input('area');
|
|
|
- // $role = Dever::input('role');
|
|
|
- // $start = Dever::input('start');
|
|
|
- // $end = Dever::input('end');
|
|
|
- // $where = array();
|
|
|
- // // if($provice){
|
|
|
- // // $where['provice'] = $provice;
|
|
|
- // // }
|
|
|
- // // if($city){
|
|
|
- // // $where['city'] = $city;
|
|
|
- // // }
|
|
|
- // if($area){
|
|
|
- // $where['area'] = $area;
|
|
|
- // }
|
|
|
- // if($role){
|
|
|
- // $where['role'] = $role;
|
|
|
- // }
|
|
|
+ #软件服务费数据统计
|
|
|
+ public function soft_cash_api(){
|
|
|
+ $start = Dever::input('start');
|
|
|
+ $end = Dever::input('end');
|
|
|
+ $where = array();
|
|
|
+ if($start && $end){
|
|
|
+ $where['fstart'] = strtotime($start);
|
|
|
+ $where['fend'] = strtotime($end);
|
|
|
+ }else{
|
|
|
+ $where['fstart']=Dever::maketime(date('Y-m-01') . ' 00:00:00');
|
|
|
+ $where['fend'] = strtotime(date('Y-m-d 23:59:59',
|
|
|
+ strtotime(date('Y-m-01')."+1 month - 1 day")));
|
|
|
+ }
|
|
|
+ $where['state'] = 1;
|
|
|
+ $data = array();
|
|
|
+ $data['start'] = date('Y-m-d',$where['fstart']);
|
|
|
+ $data['end'] = date('Y-m-d',$where['fend']);
|
|
|
+ #软件服务费的已确认数量
|
|
|
+ $where['soft_cash']=1;
|
|
|
+ $where['status'] = 4;
|
|
|
+ $order = Dever::db('agent/order')->getSoftNum($where);
|
|
|
+ $where['status'] = 3;
|
|
|
+ $soft_cash = Dever::db('agent/soft_cash')->getSoftNum($where);
|
|
|
+ $data['num'] = $order + $soft_cash;
|
|
|
+ #软件服务费未确认的数量
|
|
|
+ $where['status'] = 4;
|
|
|
+ $order = Dever::db('agent/order')->getSoftNoNum($where);
|
|
|
+ $where['status'] = 3;
|
|
|
+ $soft_cash = Dever::db('agent/soft_cash')->getSoftNoNum($where);
|
|
|
+ $data['no_num'] = $order + $soft_cash;
|
|
|
+ #总数量
|
|
|
+ $data['total_num'] = $data['num'] + $data['no_num'];
|
|
|
+
|
|
|
+ #已确认软件服务费
|
|
|
+ $where['status'] = 4;
|
|
|
+ $order = Dever::db('agent/order')->getSoftCash($where);
|
|
|
+ $where['status'] = 3;
|
|
|
+ $soft_cash = Dever::db('agent/soft_cash')->getSoftCash($where);
|
|
|
+ $data['money'] = $order['total'] + $soft_cash['total'];
|
|
|
+ #未确认软件服务费
|
|
|
+ $where['status'] = 4;
|
|
|
+ $order = Dever::db('agent/order')->getSoftNoCash($where);
|
|
|
+ $where['status'] = 3;
|
|
|
+ $soft_cash = Dever::db('agent/soft_cash')->getSoftNoCash($where);
|
|
|
+ $data['no_money'] = $order['total'] + $soft_cash['total'];
|
|
|
+ #总钱数
|
|
|
+ $data['total_money'] = $data['money'] + $data['no_money'];
|
|
|
+ #合同已确认数量:
|
|
|
+ $where['status'] = 2;
|
|
|
+ $data['a_num'] = Dever::db('agent/member_agreement')->getNum($where);
|
|
|
+ #合同未确认数量:
|
|
|
+ $where['status'] = 2;
|
|
|
+ $data['a_nonum'] = Dever::db('agent/member_agreement')->getNoNum($where);
|
|
|
+ $data['a_totalnum'] = $data['a_num'] + $data['a_nonum'];
|
|
|
+ #合同已确认软件服务费
|
|
|
+ $where['status'] = 2;
|
|
|
+ $price = Dever::db('agent/member_agreement')->getPrice($where);
|
|
|
+ if($price['total']){
|
|
|
+ $data['a_price'] = $price['total'];
|
|
|
+ }else{
|
|
|
+ $data['a_price'] = 0;
|
|
|
+ }
|
|
|
|
|
|
- // if($start && $end){
|
|
|
- // $where['start'] = strtotime($start);
|
|
|
- // $where['end'] = strtotime($end);
|
|
|
- // }else{
|
|
|
- // $where['start']=Dever::maketime(date('Y-m-01') . ' 00:00:00');
|
|
|
- // $where['end'] = strtotime(date('Y-m-d 23:59:59',
|
|
|
- // strtotime(date('Y-m-01')."+1 month - 1 day")));
|
|
|
- // }
|
|
|
- // $data = Dever::db('agent/order')->getAll($where);
|
|
|
- // $rest = array();
|
|
|
- // foreach($data as $k => $v){
|
|
|
- // $data[$k]['area_name'] = Dever::load("area/api.string", $v['area']);
|
|
|
- // $role = Dever::db('setting/role')->find($v['role']);
|
|
|
- // $data[$k]['role_name'] = $role['name'];
|
|
|
- // }
|
|
|
- // $rest['role'] = Dever::db('setting/role')->find();
|
|
|
- // $rest['start'] = date('Y-m-d',$where['start']);
|
|
|
- // $rest['end'] = date('Y-m-d',$where['end']);
|
|
|
- // $rest['data'] = $data;
|
|
|
- // return Dever::render('city', $rest);
|
|
|
- // }
|
|
|
+ #合同未确认软件服务费
|
|
|
+ $where['status'] = 2;
|
|
|
+ $noprice = Dever::db('agent/member_agreement')->getNoPrice($where);
|
|
|
+ if($noprice['total']){
|
|
|
+ $data['a_noprice'] = $noprice['total'];
|
|
|
+ }else{
|
|
|
+ $data['a_noprice'] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ #总钱数
|
|
|
+ $data['total_price'] = $data['a_price'] + $data['a_noprice'];
|
|
|
+ return Dever::render('soft_cash', $data);
|
|
|
+ }
|
|
|
}
|