关于这部分容,我将在之后学习中持续补充
方法1:
直接调用
<?php
namespace Home\Controller;
use Think\Controller;}
class Ftypecontroller extends Controller{
public function issueftype(){
// 实例化ftype_table对象,其中ftype为数据库名
$ftype_table = M("ftype"); }
//定义 $map的条件
$map['is_deal'] = 1; }
// 实例化type_out方法,查询数据库中满足 $map条件的数据
$type_out = $ftype_table->where($ftype)->select();
//打印type_out
echo json_encode($type_out);}
}
}
接口展示:http://47.92.94.169/index.php/Home/ftype/issueftype
方法2:
一句话打印数据库中全部值
<?php
namespace Home\Controller;
use Think\Controller;
header("content-type:text/html; charset=utf-8");
class FtypeTestcontroller extends Controller {
public functi