Пример #1
0
 /**
  * @type 多次更改需判断
  * @method foreach $rt['id'] $rt['options'] ok
  * @param unknown $project_id
  */
 public static function getInqueryQuestion($project_id)
 {
     self::checkConnect();
     return InqueryQuestion::find(array("project_id = :project_id:", 'bind' => array('project_id' => $project_id), 'hydration' => \Phalcon\Mvc\Model\Resultset\Simple::HYDRATE_ARRAYS, 'cache' => array('key' => 'inquery_question_by_project_id_' . $project_id)));
 }
Пример #2
0
 public function getinqueryAction()
 {
     $manager = $this->session->get('Manager');
     if ($manager) {
         $inquery_detail = InqueryQuestion::find(array('project_id=?1', 'bind' => array(1 => $manager->project_id)));
         $ans = array();
         if (count($inquery_detail) == 0) {
             $ans['state'] = false;
         } else {
             $ans['state'] = true;
         }
         if ($ans['state']) {
             $ans['result'] = $inquery_detail->toArray();
         } else {
             $ans['result'] = '';
         }
         $this->dataReturn(array('success' => $ans));
         return;
     } else {
         $this->dataReturn(array('error' => "您的身份验证出错,请重新登录"));
         return;
     }
 }
Пример #3
0
 public static function getProjectStateNext($project, $type)
 {
     #项目状态更新前的判断
     if ($project->state == 2) {
         $state = 2;
     } else {
         if ($project->state == 0) {
             $state = 1;
         } else {
             // 1 -- 表示二者必居其一
             $inquery = InqueryQuestion::findFirst(array('project_id=?1', 'bind' => array(1 => $project->id)));
             if (isset($inquery->project_id)) {
                 if ($type) {
                     $state = 2;
                 } else {
                     $state = 1;
                 }
             } else {
                 if ($type) {
                     $state = 1;
                 } else {
                     $state = 2;
                 }
             }
         }
     }
     return $state;
 }