|
@@ -68,6 +68,7 @@ class Api
|
|
|
*/
|
|
|
public function submit($uid, $product_id, $order_id, $page_number, $survey_id, $survey_answer)
|
|
|
{
|
|
|
+ $result = 1;
|
|
|
if ($survey_id && $survey_answer) {
|
|
|
$survey_id = explode('||', $survey_id);
|
|
|
$survey_answer = explode('||', $survey_answer);
|
|
@@ -99,10 +100,15 @@ class Api
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if ($num == $total || $page_number > 0) {
|
|
|
- $user = Dever::db('survey/user')->one(array('uid' => $uid, 'product_id' => $product_id, 'order_id' => $order_id));
|
|
|
- if ($user) {
|
|
|
+ $user = Dever::db('survey/user')->one(array('uid' => $uid, 'product_id' => $product_id, 'order_id' => $order_id));
|
|
|
+ if ($user) {
|
|
|
+ if ($page_number == $user['index']) {
|
|
|
+ $result = 2;
|
|
|
+ } else {
|
|
|
+ $result = 1;
|
|
|
+ }
|
|
|
|
|
|
+ if ($num == $total || $page_number > 0) {
|
|
|
$user['index'] = $user['index'] + 1;
|
|
|
if ($page_number) {
|
|
|
$user['index'] = $page_number;
|
|
@@ -112,7 +118,7 @@ class Api
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return true;
|
|
|
+ return $result;
|
|
|
}
|
|
|
|
|
|
|