dever 7 anni fa
parent
commit
81fb5c2bce
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      src/Api.php

+ 8 - 1
src/Api.php

@@ -101,8 +101,15 @@ class Api
 			}
 
 			$user = Dever::db('survey/user')->one(array('uid' => $uid, 'product_id' => $product_id, 'order_id' => $order_id));
+
+			$page = Dever::db('survey/info')->getOne(array('product_id' => $product_id));
+			if ($page) {
+				$user['page_total'] = $page['page_number'];
+			} else {
+				$user['page_total'] = 0;
+			}
 			if ($user) {
-				if ($page_number == $user['index']) {
+				if ($page_number >= $page['page_total']) {
 					$result = 2;
 				} else {
 					$result = 1;