Beispiel #1
0
 /**
  * 设计师
  */
 public function shejishi()
 {
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $m = M("Shejiview");
     import("ORG.Util.Page");
     $map = "1";
     $keys = trim($_GET['keys']);
     $keys = $keys == "请输入关键字" ? "" : $keys;
     $start_date = trim($_GET['start_date']);
     $this->assign("start_date", $start_date);
     $end_date = trim($_GET['end_date']);
     $this->assign("end_date", $end_date);
     if (!empty($start_date)) {
         $start_date = strtotime($start_date . "0:0:0");
         $map .= " and UNIX_TIMESTAMP(create_time)>= " . $start_date;
     }
     if (!empty($end_date)) {
         $end_date = strtotime($end_date . "23:59:59");
         $map .= " and UNIX_TIMESTAMP(create_time)<= " . $end_date;
     }
     //城市-------------------------------start
     $is_qx = $this->getqx($_SESSION['my_info']['role']);
     $citymod = new CityModel();
     if ($is_qx == 0) {
         //非地区管理员
         $p_id = $_GET['province'];
         $c_id = $_GET['city'];
         $pro_list = $citymod->getprovince(1);
         $this->assign("pro_list", $pro_list);
     } else {
         $p_id = $_SESSION['my_info']['proid'];
         $c_id = $_SESSION['my_info']['cityid'];
         $qulist = $citymod->getcity($c_id);
         $this->assign("qulist", $qulist);
     }
     if (!empty($p_id)) {
         $map .= " and p_id=" . $p_id;
     }
     if (!empty($c_id)) {
         $map .= " and c_id=" . $c_id;
     }
     $this->assign("province", $p_id);
     $this->assign("city", $c_id);
     $this->assign("is_qx", $is_qx);
     $qu = $_GET['qu'];
     $this->assign("qu", $qu);
     $cityname = $citymod->getname($c_id);
     $this->assign("cityname", $cityname);
     $quname = $citymod->getname($qu);
     $this->assign("quname", $quname);
     if (!empty($qu)) {
         $map .= " and q_id=" . $qu;
     }
     //城市------------------------end
     if (!empty($keys)) {
         $map .= " and (truename like '%" . $keys . "%')";
     }
     $cou = $m->where($map)->order("a_id desc")->count();
     $page = new Page($cou, 12);
     $showpage = $page->show();
     $list = $m->where($map)->order("a_id desc")->select();
     $this->assign("list", $list);
     $this->assign("page", $showpage);
     $memmod = new MemberModel();
     $year = $memmod->getyear();
     $this->assign("year", $year);
     $month = $memmod->getmonth();
     $this->assign("month", $month);
     $days = $memmod->getday($year[0], $month[0]);
     $this->assign("day", $days);
     $this->assign("keys", $keys);
     $this->display();
 }