续费率
This commit is contained in:
parent
86c6765edc
commit
7589d9afaf
@ -33,19 +33,19 @@ class RenewalService extends Service
|
||||
}
|
||||
|
||||
if($conditions['activate_start_time']){
|
||||
$where .= 'AND c.service_start_at >= ' . $conditions['activate_start_time'] . ' ';
|
||||
$where .= "AND c.service_start_at >= '" . $conditions['activate_start_time'] . "' ";
|
||||
}
|
||||
|
||||
if($conditions['activate_end_time']){
|
||||
$where .= 'AND c.service_end_at <= ' . $conditions['activate_end_time'] . ' ';
|
||||
$where .= "AND c.service_end_at <= '" . $conditions['activate_end_time'] . "' ";
|
||||
}
|
||||
|
||||
if($conditions['renewal_start_time']){
|
||||
$where .= 'AND p.service_start_at >= ' . $conditions['renewal_start_time'] . ' ';
|
||||
$where .= "AND p.service_start_at >= '" . $conditions['renewal_start_time'] . "' ";
|
||||
}
|
||||
|
||||
if($conditions['renewal_start_time']){
|
||||
$where .= 'AND p.service_start_at >= ' . $conditions['renewal_start_time'] . ' ';
|
||||
$where .= "AND p.service_start_at >= '" . $conditions['renewal_start_time'] . "' ";
|
||||
}
|
||||
|
||||
$sql = $sql . $where . $group;
|
||||
@ -56,7 +56,7 @@ class RenewalService extends Service
|
||||
return [];
|
||||
}
|
||||
|
||||
foreach ($data as $item) {
|
||||
foreach ($data as &$item) {
|
||||
$item = (array)$item;
|
||||
$item['company_name'] = CompanyService::load($item['company_id'])['name'];
|
||||
$item['ratio'] = $item['activates'] == 0 ? 0 : $item['renewals']/$item['activates'];
|
||||
|
@ -7,10 +7,8 @@ export default {
|
||||
},
|
||||
options: {
|
||||
name: '',
|
||||
time: [
|
||||
this.moment().subtract('1', 'months').startOf('month').format('YYYY-MM-DD'),
|
||||
this.moment().subtract('1', 'months').endOf('month').format('YYYY-MM-DD')
|
||||
]
|
||||
activate_time: [],
|
||||
renewal_time: []
|
||||
},
|
||||
data: [],
|
||||
list: [],
|
||||
@ -68,6 +66,26 @@ export default {
|
||||
limit: 0
|
||||
}, options);
|
||||
|
||||
console.log(params);
|
||||
|
||||
for (let k in params) {
|
||||
if (k == "activate_time") {
|
||||
if (params.activate_time && params.activate_time[0] && params.activate_time[1]) {
|
||||
params.activate_start_time = this.moment(params.activate_time[0]).format("YYYY-MM-DD") + " 00:00:00";
|
||||
params.activate_end_time = this.moment(params.activate_time[1]).format("YYYY-MM-DD") + " 23:59:59";
|
||||
params.activate_time = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
if (k == "renewal_time") {
|
||||
if (params.renewal_time && params.renewal_time[0] && params.renewal_time[1]) {
|
||||
params.renewal_start_time = this.moment(params.renewal_time[0]).format("YYYY-MM-DD") + " 00:00:00";
|
||||
params.renewal_end_time = this.moment(params.renewal_time[1]).format("YYYY-MM-DD") + " 23:59:59";
|
||||
params.renewal_time = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.isShowLoading(true);
|
||||
|
||||
service.get('api/stats/renewal', {
|
||||
|
Loading…
x
Reference in New Issue
Block a user