|
@@ -189,25 +189,26 @@ class After extends \app\BaseController
|
|
|
* @throws \think\db\exception\DbException
|
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
*/
|
|
|
- public function info(){
|
|
|
- $bkcode = isset($this->post['returnCode']) && $this->post['returnCode']!="" ? trim($this->post['returnCode']):"";
|
|
|
- if($bkcode==""){
|
|
|
- return error_show(1005,"参数returnCode 不能为空");
|
|
|
+ public function info()
|
|
|
+ {
|
|
|
+ $bkcode = isset($this->post['returnCode']) && $this->post['returnCode'] != "" ? trim($this->post['returnCode']) : "";
|
|
|
+ if ($bkcode == "") {
|
|
|
+ return error_show(1005, "参数returnCode 不能为空");
|
|
|
}
|
|
|
- $info = Db::name("order_return")->alias("a")->leftJoin("order_returninfo b","a.returnCode=b.returnCode")
|
|
|
+ $info = Db::name("order_return")->alias("a")->leftJoin("order_returninfo b", "a.returnCode=b.returnCode")
|
|
|
->field("a.*,b.return_wsm,b.contactor,b.mobile,b.addr,b.addr_code,b.post_code,b.post_company,b.post_fee,b.gys_remark")
|
|
|
- ->where(['a.returnCode'=>$bkcode])->find();
|
|
|
- if(empty($info)){
|
|
|
- return error_show(1005,"未找到售后数据");
|
|
|
- }
|
|
|
- $orderinfo = Db::name("sale")->where(["orderCode"=>$info["orderCode"]])->find();
|
|
|
- $info['origin_price']=$orderinfo['origin_price'];
|
|
|
- $info['order_type']=$orderinfo['order_type'];
|
|
|
- $info['sale_price']=$orderinfo['sale_price'];
|
|
|
- $info['total_price']=sprintf("%1\$.2f",$orderinfo['sale_price']*$info['error_num']);
|
|
|
- if($orderinfo['order_type']==3|| $orderinfo['order_type']==4){
|
|
|
- $goon = Db::name("good_zixun")->where(["spuCode"=>$orderinfo['good_code'],"is_del"=>0])->find();
|
|
|
- }else {
|
|
|
+ ->where(['a.returnCode' => $bkcode])->find();
|
|
|
+ if (empty($info)) {
|
|
|
+ return error_show(1005, "未找到售后数据");
|
|
|
+ }
|
|
|
+ $orderinfo = Db::name("sale")->where(["orderCode" => $info["orderCode"]])->find();
|
|
|
+ $info['origin_price'] = $orderinfo['origin_price'];
|
|
|
+ $info['order_type'] = $orderinfo['order_type'];
|
|
|
+ $info['sale_price'] = $orderinfo['sale_price'];
|
|
|
+ $info['total_price'] = sprintf("%1\$.2f", $orderinfo['sale_price'] * $info['error_num']);
|
|
|
+ if ($orderinfo['order_type'] == 3 || $orderinfo['order_type'] == 4) {
|
|
|
+ $goon = Db::name("good_zixun")->where(["spuCode" => $orderinfo['good_code'], "is_del" => 0])->find();
|
|
|
+ } else {
|
|
|
$goon = Db::name('good_platform')->alias('a')->join('good b', 'b.spuCode=a.spuCode', 'left')
|
|
|
->where(['a.skuCode' => $orderinfo['skuCode']])->find();
|
|
|
}
|
|
@@ -215,8 +216,11 @@ class After extends \app\BaseController
|
|
|
return error_show(1003, "未找到商品数据");
|
|
|
}
|
|
|
$int = isset($goon['cat_id']) && $goon['cat_id'] != 0 ? made($goon['cat_id']) : [];
|
|
|
- list($a,$b,$c)=explode(",",$info['addr_code']);
|
|
|
- $addcode =json_encode(["provice_code"=>$a,"city_code"=>$b,"area_code"=>$c]);
|
|
|
+ $addcode = '';
|
|
|
+ if ($info['addr_code'] != "") {
|
|
|
+ list($a, $b, $c) = explode(",", $info['addr_code']);
|
|
|
+ $addcode = json_encode(["provice_code" => $a, "city_code" => $b, "area_code" => $c]);
|
|
|
+ }
|
|
|
$info["addr_cn"]=GetAddr($addcode);
|
|
|
// $info["addr_code"]=json_decode($addcode,true);
|
|
|
$out =Db::name("order_out")->where(["outCode"=>$info['outCode']])->find();
|