Commit cd522e69 authored by 蔡闯's avatar 蔡闯

2020

parent ed5d5e89
...@@ -25,7 +25,15 @@ abstract class BaseController ...@@ -25,7 +25,15 @@ abstract class BaseController
protected $myUnit = [ protected $myUnit = [
'water' =>"吨", 'water' =>"吨",
'electric' =>'度', 'electric' =>'度',
'gas' =>'立方' 'gas' =>'立方',
'property' =>'平方米'
];
protected $priceUnit = [
'water' =>"元/吨",
'electric' =>'元/度',
'gas' =>'元/立方米',
'property' =>'元/平方米'
]; ];
/** /**
* Request实例 * Request实例
......
...@@ -191,7 +191,33 @@ class Payorder extends Base ...@@ -191,7 +191,33 @@ class Payorder extends Base
public function getDetailPay(){ public function getDetailPay(){
$cost_id = Request::param('cost_id'); $cost_id = Request::param('cost_id');
$data = Db::name('cost')->where(['cost_id'=>$cost_id])->find(); $data = Db::name('cost')->where(['cost_id'=>$cost_id])->find();
return $this->returnJson(Common::changeField($data)); $typeArr = $this->convertArr;
$vacancyInfo = Db::name('house_vacancy')->where(['vacancy_id'=>$data['vacancy_id']])->field('vacancy_code,layout_id')->find();
$vacancyAddress = Common::getVacancyAddress($vacancyInfo['vacancy_code'],$vacancyInfo['layout_id']);
$data['vacancy_address'] = $vacancyAddress['vacancy_address'];
$data['type_zh'] = isset($typeArr[$data['type']]) ? $typeArr[$data['type']] : "自定义";
if($data['is_pay']==1) {
$orderInfo = Db::name('pay_order')->where(['order_id'=>$data['order_id']])->field('order_num,pay_type')->find();
if($orderInfo) {
$data['pay_type'] = $orderInfo['pay_type'];
$data['order_num'] = $orderInfo['order_num'];
} else {
$data['pay_type'] = "暂无";
$data['order_num'] = "暂无";
}
} else {
$data['pay_type'] = "暂无";
$data['order_num'] = "暂无";
}
$myunit = $this->myUnit;
$priceUnit = $this->priceUnit;
if(in_array($data['type'],['water','electric','gas','property'])) {
$data['area'] = $data['area'].$myunit[$data['type']];
$data['price'] = $data['price'].$priceUnit[$data['type']];
} else{
$data['area'] = "无";
}
return $this->returnJson(Common::changeField($data,['pay_time','create_time']));
} }
...@@ -282,6 +308,10 @@ class Payorder extends Base ...@@ -282,6 +308,10 @@ class Payorder extends Base
$res= $this->getAliPaySign($param); $res= $this->getAliPaySign($param);
Db::name('pay_order')->where(['order_id'=>$order_id])->save(['pay_type'=>"支付宝"]); Db::name('pay_order')->where(['order_id'=>$order_id])->save(['pay_type'=>"支付宝"]);
$cost_ids = json_encode($orderInfo['cost_ids']);
Db::name('pay_order')->whereIn('cost_id',$cost_ids)->save(['order_id'=>$order_id]);
//微信支付 //微信支付
} else { } else {
$param['order_id'] = $orderInfo['order_id']; $param['order_id'] = $orderInfo['order_id'];
...@@ -292,6 +322,9 @@ class Payorder extends Base ...@@ -292,6 +322,9 @@ class Payorder extends Base
//更改订单的支付方式 //更改订单的支付方式
Db::name('pay_order')->where(['order_id'=>$order_id])->save(['pay_type'=>"微信"]); Db::name('pay_order')->where(['order_id'=>$order_id])->save(['pay_type'=>"微信"]);
} }
//修改cost表
$cost_ids = json_encode($orderInfo['cost_ids']);
Db::name('pay_order')->whereIn('cost_id',$cost_ids)->save(['order_id'=>$order_id]);
return $this->returnJson($res); return $this->returnJson($res);
} else { } else {
return $this->returnJson([],'非法的订单信息!',400); return $this->returnJson([],'非法的订单信息!',400);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment