<code>public function postStore(Request $request){
switch ($request->input('type')) { //对提交过来的type进行判断
case 'redBagCart':
$type=1;
$order_type='HB';
break;
default:
$type=0;
$order_type='WX';
break;
}
...
Log::info($request->input('type')); //记录到日志里
})
</code>大概代码如上,可是奇怪的一点是,我数据库有对这个$order_type进行记录,数据库记录的是hb,也就是$request->input('type')是redbagcart,可是日志里记录的却是'',空。
为什么会这样。
<code>public function postStore(Request $request){
switch ($request->input('type')) { //对提交过来的type进行判断
case 'redBagCart':
$type=1;
$order_type='HB';
break;
default:
$type=0;
$order_type='WX';
break;
}
...
Log::info($request->input('type')); //记录到日志里
})
</code>大概代码如上,可是奇怪的一点是,我数据库有对这个$order_type进行记录,数据库记录的是hb,也就是$request->input('type')是redbagcart,可是日志里记录的却是'',空。
为什么会这样。
$data['provinceName']哪里来的?Log::info('mylog', ['type'=>$request->input('type')]);
可以试试把$request->input('type')赋值给一个变量再使用
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号