接口功能说明: 前端提交学生学号(sno)给Api,Api接口返回此学生的基本信息
API接口端
namespace app\index\controller;
use think\Controller;
use app\index\model\Student;
class User{
public function index() {
return $this->fetch();
}
// 客户端提交学生学号(sno)给api,api返回此学生的基本信息
public function api($sno=‘0001’) {
// 查询 并把数据赋值给 $data
d a t a = S t u d e n t : : g e t B y s n o ( data = Student::getBysno( dat