<?php
namespace app\admin\controller;
use app\model\Admin;
use think\Controller;
class Login extends Controller
{
public function login()
{
if(request()->isPost()){
//测试接受前端数据
//halt($_POST);
//将接收的数据传到模型层model
$res=(new Admin())->login(input('post.'));
}
return $this->fetch();
}
}
<?php
namespace app\model;
use think\Loader;
use think\Model;
class Admin extends Model{
public function login($data){
halt($data);
}
}
?>