|
@@ -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 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;
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ $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);
|
|
|
+ }
|
|
|
}
|