|
|
|
@ -1,6 +1,7 @@
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
namespace App\Services;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\API\AspNetZhuanController;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
|
|
|
|
class OrderService
|
|
|
|
class OrderService
|
|
|
|
@ -71,4 +72,41 @@ class OrderService
|
|
|
|
return ['department_list'=>$de_list,'wait_day'=>"10"];
|
|
|
|
return ['department_list'=>$de_list,'wait_day'=>"10"];
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function Cancel($orderInfo)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$person=DB::table('web_user_person')->where(['id' => $orderInfo->person_id])->first();
|
|
|
|
|
|
|
|
$now_datetime=date('Y-m-d H:i:s');
|
|
|
|
|
|
|
|
//调用接口恢复积分和预存款
|
|
|
|
|
|
|
|
$env=config('app.globals.Env');
|
|
|
|
|
|
|
|
$AspNet=new AspNetZhuanController();
|
|
|
|
|
|
|
|
$jifen_huifu_status=true;
|
|
|
|
|
|
|
|
$yucunkuan_huifu_status=true;
|
|
|
|
|
|
|
|
$yyid=$orderInfo->hospital_id;
|
|
|
|
|
|
|
|
if($yyid==1) $yyid=6;
|
|
|
|
|
|
|
|
if($env=='pro') { //如果是正式环境
|
|
|
|
|
|
|
|
if($orderInfo->jifen>0 and $orderInfo->is_refund_jifen==0) {
|
|
|
|
|
|
|
|
$jifen_huifu_status=false;
|
|
|
|
|
|
|
|
$jifen_huifu_status= $AspNet::UseJiFen($person->ghzid,$orderInfo->jifen,$yyid,$orderInfo->id,'tj_h5','抵扣体检H5订单',$now_datetime);
|
|
|
|
|
|
|
|
if( $jifen_huifu_status===true){
|
|
|
|
|
|
|
|
DB::table('orders')->where('id',$orderInfo->id)->update(['is_refund_jifen'=>1]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if($orderInfo->yucunkuan>0 and $orderInfo->is_refund_yucunkuan==0) {
|
|
|
|
|
|
|
|
$yucunkuan_huifu_status=false;
|
|
|
|
|
|
|
|
$yucunkuan_huifu_status= $AspNet::UseYuCunKuan($person->ghzid,$orderInfo->yucunkuan,$yyid,0,$orderInfo->id,'tj_h5','抵扣体检H5订单',$now_datetime);
|
|
|
|
|
|
|
|
if($yucunkuan_huifu_status===true){
|
|
|
|
|
|
|
|
DB::table('orders')->where('id',$orderInfo->id)->update(['is_refund_yucunkuan'=>1]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DB::table('orders')->where(['id' => $orderInfo->id,'status'=>1])->update([
|
|
|
|
|
|
|
|
'status' => 3
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
//恢复号源
|
|
|
|
|
|
|
|
$up_plan = DB::table('plans')->where(['id' => $orderInfo->plan_id, 'status' => 2])->update([
|
|
|
|
|
|
|
|
'status' => 1
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|