ThinkPHP5中模型关联关系一对一,一对多
TP5 返回json反斜杠前面转义了
class XinDai extends Controller{ public function index(){
$res = [
['logo'=>'/images/pro_01.jpg','title'=>'精英贷','desc'=>'25周岁以上即可\n最快3小时下款\n件均8万,最高20万'],
['logo'=>'/images/pro_02.jpg','title'=>'月供贷','desc'=>'22周岁以上即可\n最快3小时下款\n件均8万,最高20万'],
['logo'=>'/images/pro_03.jpg','title'=>'保单贷','desc'=>'22周岁以上即可\n最快3小时下款\n件均8万,最高20万'],
['logo'=>'/images/pro_03.jpg','title'=>'test','desc'=>'22周岁以上即可\n最快3小时下款\n件均8万,最高20万'],
];
return stripslashes(json_encode($res, JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE));
}
}
ThinkPHP5中模型的一对一关联关系
https://www.jianshu.com/p/b8a8d498eda9
实例讲解TP5中关联模型
https://blog.csdn.net/github_37512301/article/details/75675054
TP5多对多关联