【发布时间】:2019-01-20 22:04:07
【问题描述】:
我想将刀片与助手连接,因为我想获取 HTML 表单字段的“名称”并在助手中使用此“名称=数量”。 我尝试使用 request 来获取 helper 的金额,但没有奏效。 有什么方法可以将 HTML 表单中的名称数量调用为帮助程序
我试过了:
$request->amount
这里是辅助函数代码:
我怎样才能看到 $deposit_amount 的定义在哪里
function updateDepositBV($id, $deposit_amount)
{
while($id !="" || $id != "0") {
if(isMemberExists($id))
{
$posid = getParentId($id);
if($posid == "0")
break;
$position = getPositionParent($id);
$currentBV = MemberExtra::where('user_id', $posid)->first();
if($position == "L"){
$new_lbv = $currentBV->left_bv + $deposit_amount ;
$new_rbv = $currentBV->right_bv;
【问题讨论】:
-
你使用的是什么版本的 Laravel?另外,你能展示一下你是如何尝试使用
$request的吗? -
主要问题是我想检查 $deposit_amount 是从哪里定义的
-
request()->input('amount')怎么样? -
你没有回答我的任何一个问题 :)
-
我可以直接从刀片获取 name = amount 到 helper.php