thinkphp getField("xxxxx", true); 得到一个字段所有值组成的的数组

很多时候我们只需要一张表里某个字段的值,组成的数组

$Channel = D('channel');
$channelList = $Channel->order('user_name')->getField("source", true);    //不带true只能查到一个值
echo json_encode($channelList); //输出 ["3333","2222","2301","1111","99901"]

猜你喜欢

转载自www.cnblogs.com/yuzhould/p/9647881.html