|
@@ -59,9 +59,6 @@ class Api
|
|
|
*/
|
|
|
public function submit($uid, $product_id, $page_number, $survey_id, $survey_answer)
|
|
|
{
|
|
|
- if ($page_number > 0) {
|
|
|
- Dever::db('survey/user')->update(array('uid' => $uid, 'index' => $page_number));
|
|
|
- }
|
|
|
if ($survey_id && $survey_answer) {
|
|
|
$survey_id = explode('||', $survey_id);
|
|
|
$survey_answer = explode('||', $survey_answer);
|
|
@@ -72,10 +69,27 @@ class Api
|
|
|
Dever::db('survey/user_answer')->update(array('where_id' => $answer['id'], 'value' => $survey_answer[$k]));
|
|
|
} else {
|
|
|
Dever::db('survey/user_answer')->insert(array('info_id' => $v, 'uid' => $uid, 'value' => $survey_answer[$k]));
|
|
|
+
|
|
|
+ if ($page_number > 0) {
|
|
|
+ $info = Dever::db('survey/user')->one(array('uid' => $uid));
|
|
|
+ if ($info) {
|
|
|
+ Dever::db('survey/user')->update(array('where_id' => $info['id'], 'index' => $page_number + 1));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ * 查看问卷信息
|
|
|
+ *
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function view($uid, $product_id, $page_number, $survey_id, $survey_answer)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
}
|