Exemplo n.º 1
0
     //$sql_count = "select count(1) from do_task where user_id = {$_SESSION['uid']} and (status=11 or status=21)";
     $sql_count = "select count(1) from do_task where user_id = {$_SESSION['uid']} and status=11";
     $count = $dbo->getCount($sql_count);
     global $action_per_page;
     $per_page = $action_per_page;
     $total_page = ceil($count / $per_page);
     if (isset($_GET['page']) && intval($_GET['page']) >= 1 && intval($_GET['page']) <= $total_page) {
         $page = intval($_GET['page']);
     } else {
         $page = 1;
     }
     // 提取当前用户做过的任务的 任务id,任务屏显名称,任务佣金,任务类型 , 完成时间 按照时间倒序
     // status: 11 - 正常完成;21 - 屏蔽;
     $sql = "select task_id, task_type, owner_name, income, time from do_task where user_id = {$_SESSION['uid']} and do_task.status = 11 order by do_id desc";
     $start = ($page - 1) * $per_page;
     $sql_res = $dbo->getPage($sql, $start, $per_page);
 } else {
     if ('ader' == $_SESSION['role']) {
         $sql_count = "select count(1) from task where owner_id = {$_SESSION['uid']}";
         $count = $dbo->getCount($sql_count);
         $per_page = 5;
         $total_page = ceil($count / $per_page);
         if (isset($_GET['page']) && intval($_GET['page']) >= 1 && intval($_GET['page']) <= $total_page) {
             $page = intval($_GET['page']);
         } else {
             $page = 1;
         }
         // 提取当前用户发布过的任务的 任务id,任务类型 任务基本佣金,任务期望数量,目前完成数量
         $sql = "select task_id, type, base_price, amount, finish_amount, create_at, expire_in from task where owner_id = {$_SESSION['uid']} order by task_id desc";
         $start = ($page - 1) * $per_page;
         $sql_res = $dbo->getPage($sql, $start, $per_page);