Browse Source

提问审批功能

caipin 7 years ago
parent
commit
5f810201ac

+ 75 - 0
protected/class/XDeode.php

@@ -0,0 +1,75 @@
+<?php
+
+/**
+ * 加密解密类
+ * 该算法仅支持加密数字。比较适用于数据库中id字段的加密解密,以及根据数字显示url的加密。
+ * @author 深秋的竹子
+ * @email  81254648@qq.com
+ * @version alpha
+ * @加密原则 标记长度 + 补位 + 数字替换
+ * @加密步骤:
+ * 将a-z,A-Z,0-9 62个字符打乱,取前M(数字最大的位数)位作为 标记长度字符串,取第M+1 到第M+10位为数字替换字符串,剩余的为补位字符串
+ * 1.计算数字长度n,取乱码的第n位作为标记长度。
+ * 2.计算补位的长度,加密串的长度N -1 - n 为补位的长度。根据指定的算法得到补位字符串。
+ * 3.根据数字替换字符串替换数字,得到数字加密字符串。
+ * 标记长度字符 + 补位字符串 + 数字加密字符串 = 加密串
+ * Usage:
+ *      $obj = new XDeode(9);
+ *      $e_txt = $obj->encode(123);
+ *      echo $e_txt.'<br/>';
+ *      echo $key->decode($e_txt);
+ */
+class XDeode {
+    private $strbase = "Flpvf70CsakVjqgeWUPXQxSyJizmNH6B1u3b8cAEKwTd54nRtZOMDhoG2YLrI";
+    private $key,$length,$codelen,$codenums,$codeext;
+    function __construct($length = 9,$key = 2543.5415412812){
+        $this->key = $key;
+        $this->length = $length;
+        $this->codelen = substr($this->strbase,0,$this->length);
+        $this->codenums = substr($this->strbase,$this->length,10);
+        $this->codeext = substr($this->strbase,$this->length + 10);
+    }
+ 
+    function encode($nums){
+        $rtn = "";
+        $numslen = strlen($nums);
+        //密文第一位标记数字的长度
+        $begin = substr($this->codelen,$numslen - 1,1);
+ 
+        //密文的扩展位
+        $extlen = $this->length - $numslen - 1;
+        $temp = str_replace('.', '', $nums / $this->key);
+        $temp = substr($temp,-$extlen);
+ 
+        $arrextTemp = str_split($this->codeext);
+        $arrext = str_split($temp);
+        foreach ($arrext as $v) {
+            $rtn .= $arrextTemp[$v];
+        }
+ 
+        $arrnumsTemp = str_split($this->codenums);
+        $arrnums = str_split($nums);
+        foreach ($arrnums as $v) {
+            $rtn .= $arrnumsTemp[$v];
+        }
+        return $begin.$rtn;
+    }
+ 
+    function decode($code){
+ 
+        $begin = substr($code,0,1);
+        $rtn = '';
+        $len = strpos($this->codelen,$begin);
+        if($len!== false){
+            $len++;
+            $arrnums = str_split(substr($code,-$len));
+            foreach ($arrnums as $v) {
+                $rtn .= strpos($this->codenums,$v);
+            }
+        }
+         
+        return $rtn;
+    }
+}
+
+?>

+ 1 - 0
protected/config/admin_menu.conf.php

@@ -5,6 +5,7 @@ $menu['navon']= array (
 							'<a href="/index/main_user_manage_expert" target="main">专家管理</a>', 
 							'<a href="/index/main_group_manage" target="main">用户组权限</a>',
 							'<a href="/index/main_vip_question_manage" target="main">名师答疑</a>',
+							'<a href="/index/main_examine_manage" target="main">审批问题</a>',
 							'<a href="/index/main_question_manage" target="main">问题管理</a>', 
 							'<a href="/index/main_answer_manage" target="main">回答管理</a>',
 							'<a href="/index/main_article_manage" target="main">公告管理</a>',

+ 6 - 0
protected/config/routes.conf.php

@@ -161,6 +161,12 @@ $route['*']['/index/main_category_delete_manage'] = array('AdminController', 'ca
 $route['*']['/index/main_category_edit_manage/:id'] = array('AdminController', 'category_manage_edit');
 $route['*']['/index/main_category_update_manage'] = array('AdminController', 'category_manage_update');
 
+//问题审批
+$route['*']['/index/main_examine_manage'] = array('AdminController', 'examine_manage');
+$route['*']['/index/examine_clear'] = array('AdminController', 'examine_manage_clear');
+$route['*']['/examine_add/:id'] = array('AdminController', 'examine_add');
+
+
 $route['*']['/index/admin_exit'] = array('AdminController', 'admin_user_exit');
 
 

+ 1 - 0
protected/config/tables.conf.php

@@ -19,4 +19,5 @@ define ( 't_article', TABLE_PREFIX . 'article' );
 define ( 't_discuss', TABLE_PREFIX . 'discuss' );
 define ( 't_bankjorunal', TABLE_PREFIX . 'bank_jorunal' );
 define ( 't_emailconfig', TABLE_PREFIX . 'email_config' );
+define ( 't_examine', TABLE_PREFIX . 'examine' );
 ?>

+ 62 - 9
protected/controller/AdminController.php

@@ -23,7 +23,6 @@ class AdminController extends DooController {
 		
 
 		Load::controller ( "BaseController" );
-		
 		$base = new BaseController ();
 		
 		$rs = $base->admin_init ();
@@ -31,7 +30,7 @@ class AdminController extends DooController {
 		$this->userinfo = $rs ['userinfo'];
 		
 		$this->menu = $rs ['menu'];
-		
+
 		Load::logic ( 'User' );
 		Load::logic ( 'Ask' );
 		Load::logic ( 'Admin' );
@@ -39,16 +38,14 @@ class AdminController extends DooController {
 		$this->userlogic = new UserLogic ();
 		$this->asklogic = new AskLogic ();
 		$this->adminlogic = new AdminLogic ();
-	
+		
 	}
 	
 	/**
 	 * 进入后台登录页面
 	 */
 	function login() {
-		
 		$data ['user_info'] = $this->userinfo;
-		
 		$this->render ( '/admin/login', $data );
 	}
 	
@@ -56,9 +53,7 @@ class AdminController extends DooController {
 	 * 用户登出
 	 */
 	function admin_user_exit() {
-		
 		setcookie ( "auth_main", "", time () + 3600 * 24, "/", COOKIE_WEB_SITE );
-		
 		$this->Messager ( "登出成功", "/" );
 	}
 	
@@ -109,9 +104,9 @@ class AdminController extends DooController {
 			
 			setcookie ( "auth_main", $userinfo, time () + 3600 * 24, "/", COOKIE_WEB_SITE );
 			
-			define ( 'MEMBER_NAME', $user ['username'] );
+			//define ( 'MEMBER_NAME', $user ['username'] );
 			
-			define ( "MASTER_ID", $user ['uid'] );
+			//define ( "MASTER_ID", $user ['uid'] );
 			
 			$data ['now'] = 'use';
 			
@@ -146,6 +141,13 @@ class AdminController extends DooController {
 	function navon() {
 		$data ['now'] = 'use';
 		
+		$list=$this->adminlogic->get_examine_list();
+		
+		if(!empty($list)){
+			$this->menu ['navon'][4]='<a href="/index/main_examine_manage" target="main">审批问题 <b style="color:#f00;">'.count($list).'</b></a>';
+		}
+		
+		
 		$data ['li'] = $this->menu ['navon'];
 		
 		$data ['map'] = '';
@@ -1334,6 +1336,57 @@ class AdminController extends DooController {
 	}
 	
 	/**
+	 * 问题审批
+	 */
+	function examine_manage(){
+		
+		$data ['examine_list'] = $this->adminlogic->get_examine_list ();
+		
+		$data ['map'] = '审批管理 ';
+		$data ['success'] = "<span style='color:red'></span> ";
+		$this->render ( '/admin/examine_manage', $data );
+	}
+	
+	/**
+	 * 清空审批列表
+	 */
+	function examine_manage_clear(){
+		
+		$this->adminlogic->examine_clear();
+		
+		$data ['examine_list']= $this->adminlogic->get_examine_list ();
+		
+		$data ['map'] = '审批管理 ';
+		$data ['success'] = "<span style='color:red'></span> ";
+		$this->render ( '/admin/examine_manage', $data );
+	}
+	
+	function examine_add(){
+		$idKey = $this->check_params ( "id" );
+		$data=$this->adminlogic->get_examine ($idKey);
+		
+		if(empty($data))
+			die('illegal request');
+		
+		$data ['category_id']=$data['cid'];
+		$id = $this->userlogic->add_question ( $data );
+		
+		if (empty($id)){//金钱不够 发送站内通知---暂停开发站内通知
+			//$this->send_email ( $data ['authorid'], "PAY_FORMONEY", $result, 0 );
+			/*			 
+			 //发送系统信息-发送给发回答用户  
+			$subject = "回答&nbsp;<a href=/askpage/" . $rs ['qid'] . " >" . $rs ['title'] . "</a>&nbsp;追问后有新的回答";		
+			$content = "回答&nbsp;<a href=/askpage/" . $rs ['qid'] . " >" . $rs ['title'] . "</a>&nbsp;追问后有新的回答";		
+			$this->messagedao->send_message ( ADMIN_NAME, 0, $question ['authorid'], $subject, $content );
+			 */
+		}
+		$this->adminlogic->examine_delete ($idKey);
+		return '/index/main_examine_manage';
+		//$rs=$this->adminlogic->examine_add ($idKey);
+		
+	}
+	
+	/**
 	 * 获取get或者POST值
 	 * @param string $name 属性名称
 	 * @return fixed 值

+ 8 - 1
protected/controller/AskController.php

@@ -459,6 +459,12 @@ class AskController extends DooController {
 	
 	/**
 	 * 显示发起问题页面
+	 * 页面代码
+		<div class="enterBtn rewardPost clearfix">
+					<a href="/question/add/credit" class="enterB">悬赏提问</a><p>在"普通提问"的情况下,提供"赏金"给回答者,能吸引高手为你解答。</p>
+				</div>
+	 *
+	 * 
 	 */
 	public function show_ask_post() {
 		
@@ -472,8 +478,9 @@ class AskController extends DooController {
 		elseif ($issue == 3)
 			$this->Messager ( "每" . $auth ['TIME_INTERVAL']/60 . "分钟内只可以发布" . $auth ['TIME_TOTALS'] . "条", "/" );
 		
+		//暂停悬赏提问功能
 		$credit = $this->check_params ( "is_credit" );
-		$data ['is_credit'] = empty ( $credit ) || $credit != "credit" ? false : true;
+		$data ['is_credit'] =false; //empty ( $credit ) || $credit != "credit" ? false : true;
 		
 		//获取分类信息
 		$data ['category'] = $this->asklogic->get_category_list ();

+ 2 - 26
protected/controller/UserController.php

@@ -144,7 +144,6 @@ class UserController extends DooController {
 	function do_login() {
 		
 		$username = $this->get_args ( "username" );
-		
 		$password = $this->get_args ( "password" );
 		
 		$day = is_numeric ( $this->get_args ( "day" ) ) ? $this->get_args ( "day" ) : 1;
@@ -160,11 +159,9 @@ class UserController extends DooController {
 		$client = new client ( ZHSSO );
 		
 		if(filter_var($username, FILTER_VALIDATE_EMAIL)){
-			
 			$is_login = $client->zhsso_member_login ( $username, $password ,1);
 			
 		}else if($this->checkMobile($username)) {
-
 			$is_login = $client->zhsso_member_login( $username, $password, 2 );
 
 		}else{
@@ -350,7 +347,6 @@ class UserController extends DooController {
 	public function do_question_close() {
 		
 		$qid = is_numeric ( $this->params ['qid'] ) ? $this->params ['qid'] : 0;
-		
 		$rs = $this->asklogic->get_question_by_uqid ( $qid, $this->userinfo ['uid'] );
 		
 		if ($qid <= 0)
@@ -381,13 +377,11 @@ class UserController extends DooController {
 	public function do_best_answer() {
 		
 		$data ['qid'] = $this->get_args ( 'qid' );
-		
 		$data ['aid'] = $this->get_args ( 'aid' );
 		
 		$data ['comment'] = $this->get_args ( 'comment' );
 		
 		$rs = $this->asklogic->get_question_by_uqid ( $data ['qid'], $this->userinfo ['uid'] );
-		
 		$ans = $this->asklogic->get_answer_by_aqid ( $data ['aid'], $data ['qid'] );
 		
 		//操作权限的判定
@@ -407,15 +401,10 @@ class UserController extends DooController {
 			$this->Messager ( "请输入正确的值", "/" );
 		
 		$data ['quid'] = $rs ['authorid'];
-		
 		$data ['auid'] = $ans ['authorid'];
-		
 		$data ['title'] = $rs ['title'];
-		
 		$data ['price'] = $rs ['price'];
-		
 		$data ['username'] = $ans ['author'];
-		
 		$this->userlogic->set_best_answer ( $data );
 		
 		header ( 'Content-Type:text/html;charset=utf-8' );
@@ -442,13 +431,9 @@ class UserController extends DooController {
 			$this->Messager ( "请填写相关信息", "/question/add_vip" );
 		
 		$phone = $this->get_args ( 'phone' );
-		
 		$qq = $this->get_args ( 'qq' );
-		
 		$this->userlogic->update_vip_question ( $rs ['id'], $title, $description, $this->userinfo ['uid'], $phone, $qq );
 		
-		
-		
 		header ( 'Content-Type:text/html;charset=utf-8' );
 		@header ( "Location: " . WEB_SITE . "/messager?content=问题发起成功&url=/advisory_page/" . $rs ['id'] );
 	}
@@ -476,18 +461,13 @@ class UserController extends DooController {
 		$rs = $this->asklogic->get_vip_question_by_paid ( $this->userinfo ['uid'] );
 		
 		$data ['mod'] = 'askpost';
-		
 		$data ['price'] = $price;
-		
 		$data ['qq'] = $this->userinfo ['qq'];
-		
 		$data ['phone'] = $this->userinfo ['phone'];
 
 		if (! empty ( $rs )) { //防止重复提交
 			$data ['qid'] = $rs ['id'];
-			
 			$data ['message'] = "您上一次付款后没有发布问题,故本次提问不做重复扣费";
-			
 			$this->render ( 'askPost_pay_2', $data );
 			
 			die ();
@@ -507,7 +487,6 @@ class UserController extends DooController {
 		
 		//确认付费
 		$data ['author'] = $this->userinfo ['username'];
-		
 		$data ['authorid'] = $this->userinfo ['uid'];
 		
 		$id = $this->userlogic->add_vip_question ( $data );
@@ -586,11 +565,8 @@ class UserController extends DooController {
 		$data ['title'] = $this->get_args ( 'title' );
 		// 防止xxs攻击
         $data['title'] = htmlspecialchars($data['title']);
-		
 		$data ['category_id'] = $this->get_args ( 'category_id' );
-		
 		$data ['description'] = stripcslashes ( $this->get_args ( 'description' ) );
-		
 		$data ['price'] = $this->get_args ( 'price' );
 		
 		if ($data ['price'] !== false) {
@@ -610,11 +586,11 @@ class UserController extends DooController {
 		if (empty ( $data ['title'] ) || (! is_numeric ( $data ['category_id'] )))
 			$this->Messager ( "问题发起不成功,请重新填写", "/question/add" );
 
-		$id = $this->userlogic->add_question ( $data );
+		$id = $this->userlogic->add_examine_question ( $data );
 		$_SESSION['vc']='NULL';
 		if ($id) {
 			header ( 'Content-Type:text/html;charset=utf-8' );
-			@header ( "Location: " . WEB_SITE . "/messager?content=问题发起成功&url=/askpage/" . $id );
+			@header ( "Location: " . WEB_SITE . "/messager?content=问题发起成功,待审批通过&url=/" );
 		} else {
 			header ( 'Content-Type:text/html;charset=utf-8' );
 			@header ( "Location: " . WEB_SITE . "/messager?content=问题发起不成功,请重新填写&url=/question/add" );

+ 64 - 7
protected/logic/AdminLogic.php

@@ -4,15 +4,13 @@
  * @author cp
  */
 class AdminLogic extends BaseLogic {
-	
 	private $categorydao;
 	private $questiondao;
 	private $creditdao;
 	private $answerdao;
 	private $messagedao;
-	
+	private $examinedao;
 	function __construct() {
-		
 		Doo::loadModel ( 'CategoryDao' );
 		Doo::loadModel ( 'QuestionDao' );
 		Doo::loadModel ( 'CreditDao' );
@@ -24,16 +22,75 @@ class AdminLogic extends BaseLogic {
 		$this->questiondao = new QuestionDao ();
 		$this->creditdao = new CreditDao ();
 		$this->answerdao = new AnswerDao ();
+		
+		Doo::loadModel ( 'ExamineDao' );
+		$this->examinedao = new ExamineDao ();
+	}
 	
+	/**
+	 * 获取审批列表
+	 */
+	function get_examine_list() {
+		$list = $this->examinedao->get_examine_list ();
+		$list = $this->_format_question_data ( $list );
+		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		
+		foreach ( $list as $key => $value ) {
+			$list [$key] ['idKey'] = $XDeode->encode ( $value ['id'] );
+		}
+		
+		return $list;
 	}
 	
 	/**
-	 * 实现接口
-	 * (non-PHPdoc)
-	 * @see BaseLogic::format_email_content()
+	 * 清空审批列表
 	 */
-	protected function format_email_content($html_templete,$templete_name,$qid,$aid){
+	function examine_clear() {
+		$this->examinedao->examine_clear ();
+	}
+	function get_examine($idKey = "") {
+		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		
+		$idKey = $XDeode->decode ( $idKey );
+		if (! is_numeric ( $idKey ))
+			return array ();
 		
+		$list = $this->examinedao->get_examine ($idKey);
+		return $list;
+	}
+	
+	function examine_delete($idKey){
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		
+		$idKey = $XDeode->decode ( $idKey );
+		if (! is_numeric ( $idKey ))
+			return 0;
+		
+		return $this->examinedao->examine_delete ($idKey);
+	}
+	
+	/**
+	 * 格式化问题数据
+	 * @param unknown_type $data
+	 */
+	function _format_question_data($data = array(), $type = "index", $time_type = "Y-m-d H:i:s") {
+		foreach ( $data as $key => $value ) {
+			$data [$key] ['time'] = my_date_format2 ( $value ['time'], $time_type );
+			$data [$key] ['status'] = format_question_status ( $value ['status'], $type );
+		}
+		return $data;
+	}
+	
+	/**
+	 * 实现接口 (non-PHPdoc)
+	 * @see BaseLogic::format_email_content()
+	 */
+	protected function format_email_content($html_templete, $templete_name, $qid, $aid) {
 	}
 }
 

+ 4 - 0
protected/logic/AskLogic.php

@@ -17,6 +17,7 @@ class AskLogic extends BaseLogic {
 	private $credit3logdao;
 	private $funddao;
 	
+	
 	function __construct() {
 		
 		Doo::loadModel ( 'CategoryDao' );
@@ -42,6 +43,8 @@ class AskLogic extends BaseLogic {
 		$this->vipanswerdao = new VipanswerDao ();
 		$this->userdao = new UserDao ();
 		$this->credit3logdao = new Credit3logDao ();
+		
+		
 	}
 	
 	/**
@@ -1292,6 +1295,7 @@ class AskLogic extends BaseLogic {
 		return $result;
 	}
 
+	
 }
 
 ?>

+ 93 - 0
protected/logic/UserLogic.php

@@ -19,6 +19,7 @@ class UserLogic extends BaseLogic {
 	private $authissuedao;
 	private $vipquestiondao;
 	private $vipanswerdao;
+	private $examinedao;
 	
 	function __construct() {
 		
@@ -51,6 +52,10 @@ class UserLogic extends BaseLogic {
 		$this->authissuedao = new AuthissueDao ();
 		$this->vipquestiondao = new VipquestionDao ();
 		$this->vipanswerdao = new VipanswerDao ();
+		
+		Doo::loadModel ( 'ExamineDao' );
+		$this->examinedao = new ExamineDao ();
+		
 	}
 	
 	/**
@@ -949,6 +954,94 @@ class UserLogic extends BaseLogic {
 	 * @param unknown_type $data
 	 * @return $result 问题ID;
 	 */
+	function add_examine_question($data = array()) {
+	
+		$this->examinedao->title = $data ['title'];
+		$this->examinedao->cid = $data ['category_id'];
+		$this->examinedao->description = $data ['description'];
+		//取绝对值
+		$price = abs ( $data ['price'] );
+		$this->examinedao->price = $price;
+		
+		$this->examinedao->author = $data ['author'];
+		$this->examinedao->authorid = $data ['authorid'];
+		$this->examinedao->time = get_date ();
+		$this->examinedao->endtime = get_date ( 15 );
+		$this->examinedao->ip = client_ip ();
+		
+		$result = $this->db ()->insert ( $this->examinedao );
+		
+		//添加提问数
+		//$this->set_questions ( 'add', $data ['authorid'], $data ['category_id'] );
+		
+		return $result;
+		
+		/**
+		 * --------------------
+		
+		//审批成功后 才记录一下相关信息
+		
+		$this->credit3logdao->ip = $this->questiondao->ip;
+		$this->credit3logdao->amount = $price;
+		$this->credit3logdao->username = $data ['author'];
+		$this->credit3logdao->uid = $data ['authorid'];
+		$this->credit3logdao->time = $this->questiondao->time;
+		
+		//扣除金额后才可以添加问题
+		if ($data ['price'] > 0) {
+			$is = $this->set_credit3 ( - $data ['price'], $data ['authorid'], RICH_ACTION_OFFER, SSO_UID );	
+			if ($is == 0)
+				return 0;
+		}
+	
+		//推广手段
+		if($data['price']==0){
+			$fundstr=file_get_contents(SITE_PATH . '/protected/config/fund.conf.php') ;
+			if($fundstr){
+				//获取基金
+				Doo::loadModel ( 'FundDao' );
+				$funddao = new FundDao ();
+				$fund=$funddao->get_fund_by_amount();
+				if(!empty($fund)){
+					$funddao->set_fund_amount_spread("-1",$fund['id']);
+					$this->questiondao->price=1;
+				}
+			}
+		}
+	
+		//发送邮件
+		if ($data ['price'] > 0) {
+				
+			$this->send_email ( $data ['authorid'], "PAY_FORMONEY", $result, 0 );
+		}
+	
+		//是否需要优化
+		if ($result) {
+			//扣除财富值--财富值记录
+			if ($data ['price'] > 0) {
+				$this->credit3logdao->qid = $result;
+	
+				$action = $this->credit3logdao->set_ACTION_OFFER_QUESTION ();
+	
+				$this->credit3logdao->add_credit3_log ( $data ['authorid'], $data ['author'], $result, $action, - $price, $this->questiondao->ip );
+			}
+				
+			//更新今天发布数--需要修改每时间段的更新次数
+			$this->authissuedao->set_authissue_totals ( $data ['authorid'] );
+			
+			//添加积分值
+			$this->set_credit1 ( 'add', $data ['authorid'], CREDIT_POINT_ADD, CREDIT_ACTION_ADD );
+		}
+	
+		return $result;
+		 */
+	}
+	
+	/**
+	 * 添加一个问题
+	 * @param unknown_type $data
+	 * @return $result 问题ID;
+	 */
 	function add_question($data = array()) {
 		
 		$this->questiondao->title = $data ['title'];

+ 103 - 0
protected/model/ExamineDao.php

@@ -0,0 +1,103 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+class ExamineDao extends DooModel {
+	public $id;
+	public $cid;
+	public $cid1;
+	public $cid2;
+	public $cid3;
+	public $price;
+	public $author;
+	public $authorid;
+	public $title;
+	public $description;
+	public $supply;
+	public $url;
+	public $time;
+	public $endtime;
+	public $phone;
+	public $hidden;
+	public $answers;
+	public $views;
+	public $goods;
+	public $status;
+	public $ip;
+	public $search_words;
+	public $delete;
+	public $_table = 'zhask_examine';
+	public $_primarykey = "id";
+	public $_fields = array (
+			'id',
+			'cid',
+			'cid1',
+			'cid2',
+			'cid3',
+			'price',
+			'author',
+			'authorid',
+			'title',
+			'description',
+			'supply',
+			'url',
+			'time',
+			'endtime',
+			'hidden',
+			'answers',
+			'views',
+			'goods',
+			'status',
+			'ip',
+			'search_words',
+			'isdelete' 
+	);
+	
+	/**
+	 * 获取问题数据
+	 * @param unknown_type $param
+	 * @param unknown_type $limit
+	 */
+	function get_examine_list() {
+		$list = $this->find ( array (
+				'where' => 'isdelete=0',
+				'desc' => 'id',
+				'asArray' => TRUE 
+		) );
+		
+		return $list;
+	}
+	
+	function get_examine($id = "") {
+	
+		if (empty($id))
+			return array();
+		
+		$list = $this->getOne ( array (
+				'where' => " id=" . $id.' and isdelete=0' ,
+				'asArray' => TRUE
+		) );
+		
+		return $list;
+	}
+	
+	/**
+	 * 清空审批列表
+	 */
+	function examine_clear() {
+		$sql = "delete from " . t_examine;
+		
+		Doo::db ()->query ( $sql );
+	}
+	
+	function examine_delete($idKey){
+
+		$this->id = $idKey;
+		$this->isdelete = 1;
+			
+		$lid = $this->update ();
+		
+		return $lid;
+	}
+	
+}
+
+?>

+ 0 - 39
protected/model/QuestionDao.php

@@ -5,53 +5,30 @@ Doo::loadCore('db/DooModel');
 class QuestionDao extends DooModel{
 	
 	public $id;
-	
 	public $cid;
-	
 	public $cid1;
-	
 	public $cid2;
-	
 	public $cid3;
-	
 	public $price;
-	
 	public $author;
-	
 	public $authorid;
-	
 	public $title;
-	
 	public $description;
-	
 	public $supply;
-	
 	public $url;
-	
 	public $time;
-	
 	public $endtime;
-	
 	public $phone;
-	
 	public $hidden;
-	
 	public $answers;
-	
 	public $views;
-	
 	public $goods;
-	
 	public $status;
-	
 	public $ip;
-	
 	public $search_words;
 	
 	public $_table = 'zhask_question';
-	
 	public $_primarykey = "id";
-	
 	public $_fields = array ('id', 'cid', 'cid1', 'cid2', 'cid3', 'price', 'author', 'authorid', 'title', 'description', 'supply', 'url', 'time', 'endtime', 'hidden', 'answers', 'views', 'goods', 'status', 'ip', 'search_words' );
 	
 	function get_QA($field="*",$condition="limit 1"){
@@ -59,9 +36,7 @@ class QuestionDao extends DooModel{
 		 //as a left join " . t_user . " as b on (a.authorid=b.uid) left join " . t_usergroup . " as c on (b.groupid=c.groupid) where id=" . $id
 		
 		$sql = "select ".$field." from ".$this->_table." as a left join ".t_answer." as b on (a.id=b.qid)  where  ".$condition;
-		
 		$query = Doo::db ()->query ( $sql );
-		
 		$result = $query->fetchAll ();
 		
 		return $result;
@@ -73,9 +48,7 @@ class QuestionDao extends DooModel{
 	function get_today_question($condition=""){
 		
 		$sql = "select count(*) as times from ".$this->_table." where from_unixtime(time,'%Y-%m-%d')=curdate() ".$condition;
-		
 		$query = Doo::db ()->query ( $sql );
-		
 		$result = $query->fetch ();
 		
 		return $result;
@@ -89,9 +62,7 @@ class QuestionDao extends DooModel{
 	function get_question_by_id($id = 0) {
 		
 		$sql = "select * from " . t_question . " where id=" . $id;
-		
 		$query = Doo::db ()->query ( $sql );
-		
 		$result = $query->fetch ();
 		
 		return $result;
@@ -109,13 +80,9 @@ class QuestionDao extends DooModel{
 			$status=" and status =".$status;
 		
 		$condition = " and hidden=0 and cid =" . $cid . " and id!=" . $id.$status;
-		
 		$condition = ' where 1 ' . $condition . $limit;
-		
 		$sql = "select * from " . t_question . $condition;
-		
 		$query = Doo::db ()->query ( $sql );
-		
 		$result = $query->fetchAll ();
 		
 		return $result;
@@ -151,11 +118,8 @@ class QuestionDao extends DooModel{
 			}
 		}
 		$condition = ' where 1' . $condition;
-		
 		$sql = "select count(*) as count from " . t_question . $condition;
-		
 		$query = Doo::db ()->query ( $sql );
-		
 		$result = $query->fetch ();
 		
 		return $result;
@@ -168,7 +132,6 @@ class QuestionDao extends DooModel{
 	function delete_question_by_authorid($uid = 0) {
 		
 		$sql = "delete from " . t_question . " where authorid = " . $uid;
-		
 		Doo::db ()->query ( $sql );
 	}
 	
@@ -179,9 +142,7 @@ class QuestionDao extends DooModel{
 	function delete_question_list($id = array()) {
 		
 		$id = implode ( ",", $id );
-		
 		$sql = "delete from " . t_question . " where id in ( " . $id . " )";
-		
 		Doo::db ()->query ( $sql );
 	}
 	

+ 59 - 0
protected/view/admin/examine_manage.html

@@ -0,0 +1,59 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link href="<?= WEB_SITE_GLOBAL ?>/img/admin/style.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/jquery-1.7.1.min.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/admin/over.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/admin/admin.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/admin/calendar.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/easydialog.min.js"></script>
+<script type="text/javascript">  
+function sumbit_sure(){  
+var gnl=confirm("你确定清空当页待审批内容吗?");  
+if (gnl==true){  
+return true;  
+}else{  
+return false;  
+}  
+}  
+</script> 
+ 
+</head>
+<body>
+  <div class="main_content">
+  
+  <form name="userForm" action="/index/examine_clear" method="post" onsubmit="return sumbit_sure()">
+  	<div class="question_list">
+  		
+		    <table cellspacing="0" cellpadding="0" class="tableList">
+					<tbody><tr class="odd">
+						
+						<th>标题</th>
+						<th>提问者</th>
+						<th>提交时间</th>
+						<th>操作</th>
+					</tr>
+					
+					<!-- loop examine_list -->
+					<tr class="">
+						
+						<td>{{examine' value.title}}</td>
+						<td>{{examine' value.author}}</td>
+						<td>{{examine' value.time}}</td>
+						<td><a class="button btn-green btn-icon" href="javascript:if(confirm('确实通过?'))location='/examine_add/{{examine' value.idKey}}'"><i class="icon iconConfirm"></i>通过</a></td>
+					</tr>
+					<!-- endloop -->
+								
+								
+					</tbody>
+				</table>
+			
+  	</div>
+  	<input type="submit" class="button btn-gray " name="submit"  value="清空当页待审批"/>
+  	
+  	</form>
+  	
+  </div>
+</body>
+</html>

+ 3 - 0
protected/view/admin/index.html

@@ -5,6 +5,9 @@
 <script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/jquery-1.7.1.min.js"></script>
 <script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/admin/over.js"></script>
 <script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/admin/admin.js"></script>
+
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/admin/notifications.js"></script>
+
 </head>
 <body>
 	<div class="warp_index">

+ 1 - 1
protected/view/askPost.html

@@ -6,7 +6,7 @@
 <div class="askPostPage">
 	<div class="postFromTab normalTab clearfix">
 	<a <!-- if {{is_credit}} -->  href="/question/add" class="normalT" <!-- else --> class="normalT tabNow" <!-- endif --> title="当前页面">普通提问</a>
-	<a <!-- if {{is_credit}} -->  class="rewardT tabNow" <!-- else -->  href="/question/add/credit" class="rewardT"  <!-- endif -->title="去发布悬赏提问">悬赏提问</a>
+	
 	<a href="/question/add_vip" class="payT" title="去发布名师答疑">名师答疑</a>
 	</div>
 	<h2>向热心网友专家们提问吧:</h2>

+ 1 - 1
protected/view/askPost_pay_2.html

@@ -4,7 +4,7 @@
 		<div class="askPostPage">
 		<div class="postFromTab normalTab clearfix">
 		<a href="/question/add" class="normalT" title="去发布普通提问">普通提问</a>
-		<a href="/question/add/credit" class="rewardT" title="去发布悬赏提问">悬赏提问</a>
+		
 		<a class="payT tabNow" title="当前页面">名师答疑</a></div>
 		<h2 class="payTitle">请将您的问题告诉我们吧:</h2>
 			<div class="globalForm">

+ 1 - 3
protected/view/postEnter.html

@@ -6,9 +6,7 @@
 				<div class="enterBtn normalPost clearfix">
 					<a href="/question/add" class="enterB">普通提问</a><p>您发布普通提问是免费的,给您回答的会是广大热心网友以及有专业背景的网友专家。</p>
 				</div>
-				<div class="enterBtn rewardPost clearfix">
-					<a href="/question/add/credit" class="enterB">悬赏提问</a><p>在"普通提问"的情况下,提供"赏金"给回答者,能吸引高手为你解答。</p>
-				</div>
+				
 				<div class="enterBtn payPost clearfix">
 					<a href="/question/add_vip" class="enterB">名师答疑</a><p>付费方可发布提问,"名师答疑"特邀省、部级专家顾问团队助阵,在公路工程造价、招投标、合同管理等方面为你指点迷津。
 					</p>