Thinkphp 5.1 model obtains original data problem
文
2019-07-10 16:05:15
0
2
1586


$data = MallUser::where(true)->getData();
return $this->success('获取数据成功',$data);

1562745084(1).jpg

Using thinkphp 5.1.37 LTS version, I need to query the original data of the data, because the model uses a getter, use the model getData () method appears, the previously used tp5.0 is no problem. After comparing the model source code of the two versions, it is indeed true that this version does not have this method. Why does this method need to be removed from this version? Is there any way to achieve this?

文

reply all(1)
郑小飒

Encapsulate the getData query method in the model yourself. The TP5 model class does not have this method.

  • reply After carefully looking at the source code, I realized that I was stupid. It turns out that this method exists, but it needs to be instantiated before it can be called. Many things are not found in the manual. Alas...
    author 2019-07-11 16:50:42
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!