edit-order-srv
This commit is contained in:
@@ -194,7 +194,7 @@ class Orders extends HD_Controller
|
||||
$fines = json_decode($row['fines'],true);
|
||||
$split = $fine_title = '';
|
||||
foreach($fines as $key=>$val){
|
||||
$price = number_format(floatval($val['price']),2);
|
||||
$price = $val['price']>0 ? number_format(floatval($val['price']),2) : '赠送';
|
||||
$fine_title .= $split."{$val['txt']}:{$price}";
|
||||
$split = ' ';
|
||||
}
|
||||
|
||||
@@ -518,21 +518,21 @@ class CusorderV2 extends Wxapp
|
||||
'value' => sprintf("%.2f", $orders_entity->total_price($row['id']))
|
||||
];
|
||||
//服务费
|
||||
$srv_data = $orders_entity->order_srv_money($row['id'], 1);
|
||||
$srv_data = $orders_entity->order_srv_money($row['id'], 1,0);
|
||||
if ($srv_data['total'] > 0) {
|
||||
$car_data['委托代办']['value'] = sprintf("%.2f", $srv_data['total']);
|
||||
foreach ($srv_data['list'] as $val) {
|
||||
$car_data['委托代办']['list'][$val['title']] = is_numeric($val['money']) ? sprintf("%.2f", $val['money']) : '';
|
||||
}
|
||||
$fines = json_decode($row['fines'], true);
|
||||
if ($fines) {
|
||||
$fines_list = [];
|
||||
foreach ($fines as $item) {
|
||||
$fines_list['list'][$item['txt']] = $item['price'] ? sprintf("%.2f", $item['price']) : '';
|
||||
}
|
||||
$fines_list['value'] = $money_json['price_fine_select'] ? sprintf("%.2f", $money_json['price_fine_select']) : 0.00;
|
||||
$car_data['委托代办']['list']['精品选装'] = $fines_list;
|
||||
}
|
||||
$fines = json_decode($row['fines'], true);
|
||||
if ($fines) {
|
||||
$fines_list = [];
|
||||
foreach ($fines as $item) {
|
||||
$fines_list['list'][$item['txt']] = $item['price']>0 ? sprintf("%.2f", $item['price']) : '赠送';
|
||||
}
|
||||
$car_data['精品选装'] = $fines_list;
|
||||
$car_data['精品选装']['value'] = sprintf("%.2f",$money_json['price_fine_select']);
|
||||
}
|
||||
$car_data['需开具本地发票'] = $row['if_local_bill'] ? '需要' : '不需要';
|
||||
}
|
||||
|
||||
@@ -160,9 +160,17 @@ class Orders_v2_entity{
|
||||
* 获取订单服务费
|
||||
* @param $oid int 订单id
|
||||
* @param $res_type string 返回数据格式
|
||||
* @param $is_fines int(0否 1是) 是否包含精品选装
|
||||
* @return int
|
||||
*/
|
||||
public function order_srv_money($oid,$res_type = ''){
|
||||
/**
|
||||
* 获取订单服务费
|
||||
* @param $oid int 订单id
|
||||
* @param $res_type string 返回数据格式
|
||||
* @param $is_fines int
|
||||
* @return array|int|mixed
|
||||
*/
|
||||
public function order_srv_money($oid,$res_type = '',$is_fines=1){
|
||||
if(!$this->order_row){
|
||||
$this->order_row = $this->ci->receiver_orders_v2_model->get(['id'=>$oid]);
|
||||
}
|
||||
@@ -196,6 +204,7 @@ class Orders_v2_entity{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($this->order_row['if_fine']){ //选择精品包
|
||||
$fine_price = $money_json['price_fine'];
|
||||
if($money_json['price_fine_discount']){ //优惠精品价格
|
||||
@@ -208,15 +217,18 @@ class Orders_v2_entity{
|
||||
'money' => $fine_price
|
||||
];
|
||||
}
|
||||
$fines = json_decode($this->order_row['fines'],true);
|
||||
if($fines){
|
||||
$price_fine_select = $money_json['price_fine_select'] ? $money_json['price_fine_select'] : 0;
|
||||
$list[] = [
|
||||
'title' => '精品选装',
|
||||
'key' => 'price_fine_select',
|
||||
'money' => $price_fine_select,
|
||||
];
|
||||
$srv_price += $price_fine_select;
|
||||
|
||||
if($is_fines){
|
||||
$fines = json_decode($this->order_row['fines'],true);
|
||||
if($fines){
|
||||
$price_fine_select = $money_json['price_fine_select'] ? $money_json['price_fine_select'] : 0;
|
||||
$list[] = [
|
||||
'title' => '精品选装',
|
||||
'key' => 'price_fine_select',
|
||||
'money' => $price_fine_select,
|
||||
];
|
||||
$srv_price += $price_fine_select;
|
||||
}
|
||||
}
|
||||
$result['total'] = $srv_price;
|
||||
$result['list'] = $list;
|
||||
@@ -715,7 +727,7 @@ class Orders_v2_entity{
|
||||
$split = $fine_title_price = $fine_title = '';
|
||||
foreach($fines as $key=>$val){
|
||||
$fine_title = $fine_title.$split.$val['txt'].$split;
|
||||
$price = number_format(floatval($val['price']),2);
|
||||
$price = $val['price']>0 ? number_format(floatval($val['price']),2) : '赠送';
|
||||
$fine_title_price = $fine_title_price.$split."{$val['txt']}:{$price}";
|
||||
$split = ' ';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user