/*
*通过申请直播
*/
public function apply_list(){
$merchant = $this->merchant;
$params = Request::instance()->param();
!empty($params['username']) && $map['zhu_phone'] = ['like','%'.$params['username'].'%'];
$is_shenhe = $params['is_shenhe'];
$map['is_shenhe'] = ['in','2,3'];
$map['is_del'] = 0;
$map['merchants_id'] = $merchant['merchants_id'];
$num = input('num');
if (empty($num)){
$num = 10;
}
$count = Db::name('Apply')->where(['is_shenhe'=>['in','2,3']])->count();
$list = Db::name('Apply')
->where($map)
->order("apply_id desc")
->paginate($num,false);
$list->toArray();//这里转一次
foreach ($list as $k=>$v){
if($v['screen_class_id']==''){
$screen_class = '未绑定';
}else{
$screen_class = '绑定';
}
$data = array();//这里
$data = $v;//这里
$data['screen_class'] = $screen_class;
$list->offsetSet($k,$data);//这里就完成转成功了
}
// echo '<pre>';
// var_dump($list);die;
$page = $list->render($count);
$this->assign(['list'=>$list,'count'=>$count,'page'=>$page]);
$url =$_SERVER['REQUEST_URI'];
Session::set('url',$url);
return $this->fetch();
}
关于TP5中后台数组对象转数组的方法
最新推荐文章于 2023-12-28 16:23:09 发布