123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace app\user\controller;
- use library\Controller;
- use think\Db;
- /**
- * 推荐管理
- * Class Invite
- * @package app\user\controller
- */
- class Invite extends Controller
- {
- protected $table ="InviteInfo";
- /**
- * 会员信息管理
- * @auth true
- * @menu true
- * @throws \think\Exception
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- * @throws \think\exception\PDOException
- */
- public function index()
- {
- $this->title = '邀请列表';
- $name = input('name');
- $phone = input('phone');
- $goods_id = input('goods_id');
- $pid = input('pid');
- $where = [];
- if($name) $where[] = ['m.name','like','%'.$name.'%'] ;
- if($phone) $where[] = ['m.phone','=',$phone] ;
- if($goods_id) $where[] = ['i.goods_id','=',$goods_id] ;
- if($pid) $where[] = ['i.pid','=',$pid] ;
- $query = $this->_query($this->table)->alias('i')
- ->field('i.*,m.name,m.headimg,m.phone');
- if(!empty($where)) $query->where($where);
- $query->join('store_member m','m.id = i.user_id','LEFT')
- ->order('i.id desc')->page();
- }
- protected function _index_page_filter(&$data)
- {
- foreach ($data as $k=>&$v){
- $parent_info = Db::table('store_member')->field('headimg,name')->find($v['pid']);
- $v['p_name'] = $parent_info['name'];
- $v['p_headimg'] = $parent_info['headimg'];
- }
- }
- }
|