weizong song 1 year ago
parent 5d7d4804a9
commit b5083cb336

@ -627,7 +627,7 @@ class OrdersController extends CommonController
public function recharge()
{
Log::channel("daily_customer_order_request")->info($this->customer->openid);
$order = (new Orders())->with("project")->find(request()->order_id);
$order = (new Orders())->with(["project", "wechatpayAccount"])->find(request()->order_id);
$openid = $this->customer->openid;
$unifiedOrder = new \UnifiedOrderPub($order->project_id);
@ -637,7 +637,7 @@ class OrdersController extends CommonController
"money" => request()->money,
"order_id" => request()->order_id,
"payment" => "weixin",
"merchant_id" => env("WEIXINPAY_MCHID")
"merchant_id" => $order->wechatpayAccount->mch_id
]);
$recharge = $recharge->getSerial();
@ -657,7 +657,7 @@ class OrdersController extends CommonController
$unifiedOrder->setParameter("notify_url", get_http_type() . $_SERVER["HTTP_HOST"] . "/customer/pay-callback");//通知地址
$unifiedOrder->setParameter("trade_type", "JSAPI");//交易类型
} catch (\Exception $exception) {
Log::channel("daily_customer_order_request")->info("order_id:".request()->order_id.":".$exception->getMessage());
Log::channel("daily_customer_order_request")->info("order_id:" . request()->order_id . ":" . $exception->getMessage());
return response()->json([
"errorcode" => $exception->getCode(),
"errormsg" => $exception->getMessage()

@ -64,6 +64,6 @@ class Project extends SoftDeletesModel
public function wechatpayAccount()
{
return $this->hasOne(WechatpayAccount::class, "id", "wechatpay_account_id");
return $this->hasOne(WechatpayAccount::class, "id", "wechatpay_account_id")->withTrashed();
}
}

@ -44,6 +44,11 @@ class Recharge extends SoftDeletesModel
return $this->belongsTo(Orders::class);
}
public function wechatpayAccount()
{
return $this->hasOneThrough(WechatpayAccount::class, Orders::class, "id", "id", "order_id", "wechatpay_account_id");
}
public function patient()
{
return $this->hasOneThrough(Patient::class, Orders::class, "id", "id", "order_id", "patient_id");

Loading…
Cancel
Save