TP5批量添加

浏览:8312 发布日期:2018/03/01 分类:ThinkPHP5专区 关键字: 批量添加
前端:
<input name="name[]" type="text">
<input name="web[]" type="text">
<input name="log[]" type="text">
后台:
$user = new NameModel;
$a=input('name/a');
$b=input('web/a');
$d=input('log/a');
$c= array_map(function($a, $b ,$d) { return array('web'=>$b,'name'=>$a,'log'=>$d); }, $a, $b ,$d);
$res=$user->saveAll($c);
最佳答案
评论( 相关
后面还有条评论,点击查看>>