private function getCurrectJobList($where, $type) { $size = self::$_size; $company = $this->getCompanyInfo(); $cpid = $company['id']; $today = strtotime(date("Y-m-d")); if ($type == 1) { $arJobList = M("job")->where("cpid='{$cpid}' and is_deleted = 0 {$where}")->select(); $jobidlist = array(); if ($arJobList) { foreach ($arJobList as $jobinfo) { if ($type == 1) { $recordCount = M("record")->where("j_id='{$jobinfo['id']}' and audstart=6")->count(); if ($recordCount < $jobinfo['employ']) { array_push($jobidlist, $jobinfo['id']); } } } } } else { $arJobList = M("job")->where("cpid='{$cpid}' and is_deleted = 0")->select(); $jobidlist = array(); if ($arJobList) { foreach ($arJobList as $jobinfo) { $recordCount = M("record")->where("j_id='{$jobinfo['id']}' and audstart=6")->count(); if ($jobinfo['endtime'] < strtotime(date("Y-m-d H:i:s")) || $recordCount >= $jobinfo['employ']) { array_push($jobidlist, $jobinfo['id']); } } } } if (!empty($jobidlist)) { $idIn = implode(",", $jobidlist); $count = M("job")->where("cpid = '{$cpid}' and is_deleted = 0 and id in (" . $idIn . ")")->count(); $page = new \Think\NewPage($count, $size); $jobList = M("job")->where("cpid = '{$cpid}' and is_deleted = 0 and id in (" . $idIn . ")")->order("starttime desc")->limit($page->firstRow, $page->listRows)->select(); if ($jobList) { $i = (($_GET['p'] ? $_GET['p'] : 1) - 1) * $size + 1; foreach ($jobList as $key => &$job) { $jobid = $job['id']; $jobList[$key]['endtime'] = date("Y-m-d", $job['endtime']); $jobList[$key]['status'] = $job['checkinfo'] == "true" ? "审核通过" : "正在审核"; $total = M("record")->where("j_id = '{$jobid}' and status=2")->count(); $noread = M("record")->where("j_id = '{$jobid}' and status=2 and news_status = 0 ")->count(); // $audstart = M("record")->where("") // $jobList[$key]['total'] = $job['employ']; $jobList[$key]['total'] = $total; $jobList[$key]['noread'] = $noread ? $noread : 0; if (!$job['title']) { $job['title'] = M("casclist")->where("id='{$job['Jobcate']}'")->getField("cascname"); } else { $job['title'] = $job['title']; } $job['sort_id'] = $i++; } } $show = $page->show(); return array("jobList" => $jobList, "page" => $show); } else { $page = new \Think\Page(0, $size); $jobList = array(array()); $show = $page->show(); return array("jobList" => false, "page" => $show); } }
public function DetailsFunds() { $username = $_SESSION['username']; $count = M("account_blance")->where("username='******'")->count(); $page = new \Think\NewPage($count, 15); $arAccountList = M("account_blance")->where("username='******' ")->order("id desc")->limit($page->firstRow, $page->listRows)->select(); $show = $page->show(); $i = (($_GET['p'] ? $_GET['p'] : 1) - 1) * 15 + 1; foreach ($arAccountList as &$arAccountInfo) { $arAccountInfo['sort_id'] = $i++; $arAccountInfo['updated_at'] = date("Y.m.d", $arAccountInfo['updated_at']); } $accountInfo = M("member")->field("bankname,banknumber,remind_member")->where("username='******'")->find(); $isFinishBank = 1; if (!$accountInfo['bankname'] || ($accountInfo['bankname'] = "" || !$accountInfo['banknumber'] || ($accountInfo['bankname'] = ""))) { $isFinishBank = 0; } $act = trim($_GET['act']); $userAccount = M("account")->where("username='******'")->find(); $this->assign("isFinishBank", $isFinishBank); $this->assign("userAccount", $userAccount); $this->assign("userAccountInfo", $accountInfo); $this->assign("act", $act); $this->assign("page", $show); $this->assign("arAccountList", $arAccountList); $this->assign("first_class", 5); $this->assign("second_class", 12); $this->display("new_money"); // $this->display(""); }