input代码
我如何 ID判断 使得控制器的参数不同
if ($request->isMethod('post')) {
if(!$request->input('stake', null)){
return view('application.info', [
'title' => '支付失敗',
'icon' => 'warn',
'content' => '参数提交不全'
]);
}
$orderNo = date("YmdHis").rand(10000,99999);
$payRequest = new PayRequest;
$payRequest->id_user = $user->id;
$payRequest->body_stake = $request->input('stake');
$payRequest->body_gateway = $request->input('gateway');
$payRequest->skl_order = $orderNo;
$payRequest->save();
$webApp=new \webApp();
$pay_memberid = "10104"; //商户ID
$pay_orderid = $orderNo; //订单号
$pay_amount = $request->input('stake'); //交易金额
$pay_applydate = date("Y-m-d H:i:s"); //订单时间
$pay_bankcode = "xxxxxx"; //银行编码
$pay_notifyurl = "xxxxxxx"; //服务端返回地址
$pay_callbackurl = "xxxxxx"; //页面跳转返回地址
$Md5key = "xxxxxxx"; //密钥
$requestarray = array(
"pay_memberid" => $pay_memberid,
"pay_orderid" => $pay_orderid,
"pay_amount" => $pay_amount,
"pay_applydate" => $pay_applydate,
"pay_bankcode" => $pay_bankcode,
"pay_notifyurl" => $pay_notifyurl,
"pay_callbackurl" => $pay_callbackurl
);
ksort($requestarray);
reset($requestarray);
$md5str = "";
foreach ($requestarray as $key => $val) {
$md5str = $md5str . $key . "=>" . $val . "&";
}
$sign = strtoupper(md5($md5str . "key=" . $Md5key));
$requestarray["pay_md5sign"] = $sign;
$requestarray["tongdao"] = "xxxxx";
$url="xxxxxxxxx";
$result = $webApp->api($url,$requestarray);
//QRcode::png($result['data']['trade_qrcode']);
return view('application.accountPayRedirect', [
'qrcode' => $result['data']['trade_qrcode'],
'money' => $request->input('stake'),
'gateway' =>$request->input('gateway')
]);
}
我需要 $pay_bankcode 跟$requestarray["tongdao"] 2个参数ID不同而不同
感谢 。如果可以 能帮我把应该写的代码写一下吗?