...
|
...
|
@@ -10,6 +10,7 @@ use Think\Db; |
|
|
class AnswerService
|
|
|
{
|
|
|
public function answer($str){
|
|
|
$str = trim(trim(htmlspecialchars_decode($str),'['),']');
|
|
|
$arr_str = explode(',',$str);
|
|
|
$question = [];
|
|
|
$start = [];
|
...
|
...
|
@@ -18,7 +19,13 @@ class AnswerService |
|
|
$score_2 = 0; //11
|
|
|
$score_3 = 0; //12-13
|
|
|
$score_4 = 0; //14-15
|
|
|
$question_title_count = Db::name('question')->where('delete_time',0)->where('parent_id',0)->count();
|
|
|
$question_this_count = count($arr_str);
|
|
|
if($question_this_count != $question_title_count){
|
|
|
return false;
|
|
|
}
|
|
|
for($i=0;$i<count($arr_str);$i++){
|
|
|
$arr_str[$i] = trim($arr_str[$i],'"');
|
|
|
$arr_q = explode('-',$arr_str[$i]);
|
|
|
if(!empty($arr_q[0]) && !empty($arr_q[1])){
|
|
|
//题目
|
...
|
...
|
@@ -29,8 +36,8 @@ class AnswerService |
|
|
$all_score +=$question_choose;
|
|
|
//查看题目是否需要单独评分
|
|
|
if($question_title['type'] == 1){
|
|
|
if(intval($question_title['min']) <= $question_choose && $question_choose <= intval($question_title['max'])){
|
|
|
array_push($question,['name'=>'第'.$question_title['order_id'].'题','content'=>$question_title['content']]);
|
|
|
if(intval($question_title['min']) <= $question_choose && $question_choose < intval($question_title['max'])){
|
|
|
array_push($question,['name'=>'','content'=>$question_title['content']]);
|
|
|
}
|
|
|
}
|
|
|
//评星分数
|
...
|
...
|
@@ -54,50 +61,57 @@ class AnswerService |
|
|
//分数归类
|
|
|
$answer = Db::name('answer')->where('delete_time',0)->select();
|
|
|
$fen = [];
|
|
|
$content = 0;
|
|
|
$content = '';
|
|
|
|
|
|
foreach ($answer as $an){
|
|
|
if(intval($an['min']) < $all_score && intval($an['max']) > $all_score ) {
|
|
|
if(intval($an['min']) <= $all_score && intval($an['max']) >= $all_score ) {
|
|
|
$fen = ['min'=>$an['min'] , 'max'=>$an['max']];
|
|
|
$content = $an['content'];
|
|
|
}
|
|
|
}
|
|
|
//评星
|
|
|
$type = 0;
|
|
|
if($all_score < 71){
|
|
|
//if($all_score < 71){
|
|
|
$type = 1;
|
|
|
if($score_1 < 18){
|
|
|
array_push($start,['num'=>1,'title'=>'知识产权情况较差','type'=>1]);
|
|
|
array_push($start,['text'=>'知识产权情况','num'=>1,'title'=>'知识产权情况较差','type'=>1]);
|
|
|
} elseif ($score_1 >= 18 && $score_1 < 21){
|
|
|
array_push($start,['num'=>2,'title'=>'知识产权情况差','type'=>1]);
|
|
|
array_push($start,['text'=>'知识产权情况','num'=>2,'title'=>'知识产权情况差','type'=>1]);
|
|
|
} elseif ($score_1 >= 21 && $score_1 < 24){
|
|
|
array_push($start,['num'=>3,'title'=>'知识产权情况一般','type'=>1]);
|
|
|
array_push($start,['text'=>'知识产权情况','num'=>3,'title'=>'知识产权情况一般','type'=>1]);
|
|
|
} elseif ($score_1 >= 24){
|
|
|
array_push($start,['num'=>4,'title'=>'知识产权情况优秀','type'=>1]);
|
|
|
array_push($start,['text'=>'知识产权情况','num'=>4,'title'=>'知识产权情况优秀','type'=>1]);
|
|
|
}
|
|
|
if($score_2 == 28){
|
|
|
|
|
|
if($score_2 == 28 || $score_2==27){
|
|
|
array_push($start,['text'=>'科技成果转化','num'=>4,'title'=>'科技成果转化优秀','type'=>2]);
|
|
|
} elseif ($score_2 == 22 || $score_2 == 16){
|
|
|
array_push($start,['text'=>'科技成果转化','num'=>3,'title'=>'科技成果转化一般','type'=>2]);
|
|
|
} elseif($score_2 == 10){
|
|
|
array_push($start,['text'=>'科技成果转化','num'=>2,'title'=>'科技成果转化较差','type'=>2]);
|
|
|
} elseif ($score_2 == 3 || $score_2 == 0){
|
|
|
array_push($start,['text'=>'科技成果转化','num'=>1,'title'=>'科技成果转化差','type'=>2]);
|
|
|
}
|
|
|
if($score_3 == 18){
|
|
|
array_push($start,['num'=>4,'title'=>'企业研发组织管理水平较好','type'=>3]);
|
|
|
array_push($start,['text'=>'企业研发组织管理水平','num'=>4,'title'=>'企业研发组织管理水平较好','type'=>3]);
|
|
|
} elseif ($score_3 == 15){
|
|
|
array_push($start,['num'=>3,'title'=>'企业研发组织管理水平好','type'=>3]);
|
|
|
array_push($start,['text'=>'企业研发组织管理水平','num'=>3,'title'=>'企业研发组织管理水平好','type'=>3]);
|
|
|
} elseif ( $score_3 == 3){
|
|
|
array_push($start,['num'=>2,'title'=>'企业研发组织管理水平差','type'=>3]);
|
|
|
array_push($start,['text'=>'企业研发组织管理水平','num'=>2,'title'=>'企业研发组织管理水平差','type'=>3]);
|
|
|
} elseif ($score_3 == 0){
|
|
|
array_push($start,['num'=>1,'title'=>'企业研发组织管理水平较差','type'=>3]);
|
|
|
array_push($start,['text'=>'企业研发组织管理水平','num'=>1,'title'=>'企业研发组织管理水平较差','type'=>3]);
|
|
|
}
|
|
|
if($score_4 >= 10){
|
|
|
array_push($start,['num'=>4,'title'=>'财务增长情况:优秀','type'=>4]);
|
|
|
array_push($start,['text'=>'财务增长情况','num'=>4,'title'=>'财务增长情况:优秀','type'=>4]);
|
|
|
} elseif ($score_4 <10 && $score_4 >=7) {
|
|
|
array_push($start,['num'=>3,'title'=>'财务增长情况:良好','type'=>4]);
|
|
|
array_push($start,['text'=>'财务增长情况','num'=>3,'title'=>'财务增长情况:良好','type'=>4]);
|
|
|
} elseif ($score_4 < 7 && $score_4 >= 5){
|
|
|
array_push($start,['num'=>2,'title'=>'财务增长情况:一般','type'=>4]);
|
|
|
array_push($start,['text'=>'财务增长情况','num'=>2,'title'=>'财务增长情况:一般','type'=>4]);
|
|
|
} elseif ($score_4 <5){
|
|
|
array_push($start,['num'=>1,'title'=>'财务增长情况:差','type'=>4]);
|
|
|
}
|
|
|
array_push($start,['text'=>'财务增长情况','num'=>1,'title'=>'财务增长情况:差','type'=>4]);
|
|
|
}
|
|
|
//}
|
|
|
|
|
|
return ['fen'=>$fen,'content'=>$content,'type'=>$type,'start'=>$start,'question'=>$question];
|
|
|
return ['fen'=>$fen,'content'=>$content,'type'=>$type,'start'=>$start,'question'=>$question,'all_fen'=>$all_score];
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|