public function index() { $userModel = M('SubUser'); I('get.date') ? $date = I('get.date') : ($date = date('Y-m-d')); $where['add_date'] = $date; if (I('get.is_pay') == 2) { $where['is_pay'] = 0; } elseif (I('get.is_pay') == 1) { $where['is_pay'] = 1; } if (I('get.phone')) { $urow = $userModel->where(array('username' => I('get.phone')))->find(); $where['tjr_uid'] = $urow['id']; } if (I('get.is_zj')) { $where['is_zj'] = I('get.is_zj'); } $list = D($this->moduleName)->field('*,count(reg_uid) as reg_num')->where($where)->group('tjr_uid')->select(); foreach ($list as $k => $v) { $tjr_row = $userModel->find($v['tjr_uid']); $list[$k]['tjr_phone'] = $tjr_row['username']; $list[$k]['tjr_name'] = $tjr_row['nickname']; } $this->assign('list', $list); $this->assign('date', $date); $row = M('SubReg')->where(array('k' => $date))->find(); $this->assign('money', $row['v']); $userRes = getSuserInfo(); $this->assign('suserSession', $userRes); $this->display(); }
public function _initialize() { header("Content-Type: text/html; charset=utf-8"); $this->moduleName = MODULE_NAME; //当前控制器Action名 $this->assign('moduleName', $this->moduleName); $this->assign('actionName', ACTION_NAME); //判断是否登录 $userRes = array(); $userRes = getSuserInfo(); if (empty($userRes)) { $this->error('没有登录或者登录超时请重新登录后继续!', U('Index/login')); } $this->assign('suserSession', $userRes); }
public function res() { $this->assign('moduleName', MODULE_NAME); $this->assign('actionName', ACTION_NAME); $where['identity'] = '1'; //类别为1是讲师 //如果是经纪人登录 $suserInfo = getSuserInfo(); if ($suserInfo['type'] == 2) { $arr = M('UserMap')->where(array('suid' => $suserInfo['id']))->select(); //查询出与该经纪人绑定的讲师 $userIdRow = array(); if ($arr) { foreach ($arr as $v) { $userIdRow[] = $v['uid']; } } $where['id'] = array('in', $userIdRow); } //行业、领域 $tradeRow = $this->arrToRow(M('Trade')->select(), 'trade_name'); $fieldRow = $this->arrToRow(M('Field')->select(), 'field_name'); //搜索条件 if ($_GET['name']) { $where['name'] = array('like', "%" . I('get.name') . "%"); } $list = D($this->moduleName)->getPager($where, 5, 'addtime desc'); $ubaseModel = M('Ubase'); $uextraModel = M('Uextra'); $provinceModel = M('Province'); $cityModel = M('City'); foreach ($list['data'] as $k => $v) { $ubaseRow = $ubaseModel->field('province_id,city_id')->where(array('uid' => $v['id']))->find(); $pRow = $provinceModel->field('name')->find($ubaseRow['province_id']); $cRow = $cityModel->field('name')->find($ubaseRow['city_id']); $uextraRow = $uextraModel->field('good_area,good_job')->where(array('uid' => $v['id']))->find(); $list['data'][$k]['province_name'] = $pRow['name']; //省份名 $list['data'][$k]['city_name'] = $cRow['name']; //城市名 $list['data'][$k]['trade_str'] = $this->idToName($uextraRow['good_job'], $tradeRow); //行业 $list['data'][$k]['field_str'] = $this->idToName($uextraRow['good_area'], $fieldRow); //领域 } $this->assign('list', $list); $this->display(); }
public function editp() { if (IS_POST) { $m = M("Suser"); $memberInfo = getSuserInfo(); $id = $memberInfo['id']; $res = $m->find($id); $p0 = md5(I('post.pass0')); $p1 = md5(I('post.pass1')); $p2 = md5(I('post.pass2')); if ($p0 != $res['pass']) { $this->error("原密码输入错误!"); } if ($p2 != $p1) { $this->error("两次密码输入不一致!"); } $result = $m->where(array('id' => $id))->setField("pass", $p1); if ($result) { $this->success("修改成功!"); } else { $this->error("修改失败!"); } } }
public function contact() { $memberInfo = getSuserInfo(); $this->assign('model', M("Suser")->find($memberInfo['id'])); $this->display(); }
public function left() { $userRes = getSuserInfo(); $this->assign('suserSession', $userRes); $this->display(); }