$smarty->setLayout('')->setTpl('mobile/templates/task_add.html')->display(); die; } } if ($_REQUEST['a'] == 'detail') { $vo = $model->find($_GET['id']); $smarty->assign('vo', $vo); //公司名称简介 $smarty->assign('uRow', $userModel->field('nickname,introduce')->where("id=" . $vo['uid'])->dataRow()); //已报名人数 $signModel = new Model_Subtable('sub_sign'); $signRow = $signModel->field('count(*) as countnum')->where("tid=" . $_GET['id'])->dataRow(); $smarty->assign('signNum', $signRow['countnum']); //评论列表 $replyModel = new Model_Subtable('sub_reply'); $replyList = $replyModel->order('id desc')->limit('5')->dataArr(); $smarty->assign('replyList', $replyList); $smarty->setLayout('')->setTpl('mobile/templates/task_detail.html')->display(); die; } //申请职位 if ($_REQUEST['a'] == 'sign') { $signModel = new Model_Subtable('sub_sign'); $data['num']['tid'] = $_GET['tid']; $data['num']['uid'] = $userRow['id']; $s = $signModel->where("tid=" . $data['num']['tid'] . " and uid=" . $data['num']['uid'])->dataRow(); if ($s) { die('ybm'); } else { $res = $signModel->add($data); $res ? die('suc') : die('err');
$pid = (int) $_GET['pid']; $feRow = $feModel->where("type=2 and pid={$pid} and fromuser='******'picuser']['fromuser'] . "'")->dataRow(); if ($feRow) { die('err'); } else { $data['info'][type] = 2; $data['info'][pid] = $pid; $data['info'][fromuser] = $_SESSION['picuser']['fromuser']; $feModel->add($data); //鸡蛋数+1 $model->query("update sub_pic set `enum`=`enum`+1 where id={$pid}"); die('suc'); } } if ($_REQUEST['a'] == 'index') { $list = $model->order('is_up desc,up_time desc,id desc')->limit('20')->dataArr(); foreach ($list as $key => $value) { $list[$key]['introduce'] = cut_str(deletehtml($value['introduce']), 15); //评论数 $replyModel = new Model_Subtable('sub_pic_reply'); $replyRow = $replyModel->field("count(id) as countnum")->where("pid='{$value['id']}'")->dataRow(); $list[$key]['countnum'] = $replyRow['countnum']; } $smarty->assign('list', $list); $smarty->setLayout('')->setTpl('mobile/templates/pic_index.html')->display(); die; } if ($_REQUEST['a'] == 'index_ajax') { $pageSize = 8; $p = $_GET['p']; $limitStr = ($p - 1) * $pageSize . ',' . $pageSize;
<?php $model = new Model_Subtable('sub_task'); //职位列表页 if ($_REQUEST['a'] == 'task_index') { $pageSize = 15; //页大小 $p = (int) $_GET['p'] < 1 ? 1 : (int) $_GET['p']; //当前页数 $limitStr = ($p - 1) * $pageSize . ',' . $pageSize; $listArr = $model->order('id desc')->limit($limitStr)->dataArr(); foreach ($listArr as $key => $value) { $listArr[$key]['title'] = cut_str(deletehtml($value['title']), 15); } if ($_GET['p']) { if ($listArr) { echo json_encode($listArr); die; } else { echo json_encode('err'); die; } } else { $smarty->assign('list', $listArr); $smarty->setLayout('')->setTpl('mobile/templates/caiwu_task_index.html')->display(); die; } } //结算页面 if ($_REQUEST['a'] == 'sign_js') { $signModel = new Model_Subtable('sub_sign');
$pid = (int) $_GET['pid']; $feRow = $feModel->where("type=2 and pid={$pid} and fromuser='******'picuser']['fromuser'] . "'")->dataRow(); if ($feRow) { die('err'); } else { $data['info'][type] = 2; $data['info'][pid] = $pid; $data['info'][fromuser] = $_SESSION['picuser']['fromuser']; $feModel->add($data); //鸡蛋数+1 $model->query("update sub_pic set `enum`=`enum`+1 where id={$pid}"); die('suc'); } } if ($_REQUEST['a'] == 'index') { $list = $model->order('is_up desc,up_time desc,id desc')->dataArr(); foreach ($list as $key => $value) { $list[$key]['introduce'] = cut_str(deletehtml($value['introduce']), 15); } $smarty->assign('list', $list); $smarty->setLayout('')->setTpl('mobile/templates/pic_index.html')->display(); die; } //评论 if ($_REQUEST['a'] == 'reply') { $replyModel = new Model_Subtable('sub_pic_reply'); if ($_GET['pid'] && $_GET['content']) { $memberModel = new Model_Member(); $data['num']['pid'] = $_GET['pid']; $data['info']['fromuser'] = $_SESSION['picuser']['fromuser']; $data['info']['name'] = $_SESSION['picuser']['nickname'];