作者 潘浩文
1 个管道 的构建 通过 耗费 1 秒

XIAOPAN

... ... @@ -11,6 +11,7 @@ namespace app\portal\controller;
use app\portal\model\UsersModel;
use cmf\controller\AdminBaseController;
use think\Db;
/**
* Class AdminUsersController
* @package app\portal\controller
... ... @@ -33,7 +34,12 @@ class AdminUsersController extends AdminBaseController{
$where['phone']=['like','%'.$param['keyword'].'%'];
}
$users=new UsersModel();
$data=$users->where($where)->order('create_time','desc')->paginate(10);
$data=$users->where($where)->order('create_time','desc')->paginate(10)->each(function ($item) {
if ($item['is_use']==1){
$item['eq']=Db::name('order')->where(['users_id'=>$item['id'],'status'=>1])->find()['eq_name'];
}
return $item;
});
$data->appends($param);
$this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : '');
$this->assign('data',$data);
... ...
... ... @@ -36,6 +36,7 @@
<th>手机号</th>
<th>是否交了押金</th>
<th>押金</th>
<th>使用设备</th>
</tr>
</thead>
<foreach name="data" item="vo">
... ... @@ -60,6 +61,13 @@
</switch>
</td>
<td>
<eq name="vo.is_use" value="1">
{$vo.eq}
<else />
未使用
</eq>
</td>
<td>
{$vo.deposit|default='0'}
</td>
</tr>
... ...