|
@@ -25,12 +25,23 @@ class Api
|
|
|
$user['status'] = 2;
|
|
|
$user['id'] = Dever::db('survey/user')->insert($user);
|
|
|
}
|
|
|
- $user['question_total'] = Dever::db('survey/info')->total(array('product_id' => $product_id));
|
|
|
|
|
|
- $result['user'] = $user;
|
|
|
if ($page_number > 0) {
|
|
|
$user['index'] = $page_number;
|
|
|
}
|
|
|
+
|
|
|
+ //$user['question_total'] = Dever::db('survey/info')->total(array('product_id' => $product_id));
|
|
|
+ $user['page'] = $user['index'];
|
|
|
+ $page = Dever::db('survey/info')->getOne(array('product_id' => $product_id));
|
|
|
+ if ($page) {
|
|
|
+ $user['page_total'] = $page['page_number'];
|
|
|
+ } else {
|
|
|
+ $user['page_total'] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ $result['user'] = $user;
|
|
|
+
|
|
|
$result['info'] = Dever::db('survey/info')->state(array('product_id' => $product_id, 'page_number' => $user['index']));
|
|
|
|
|
|
if ($result['info']) {
|