예제 #1
0
 public function view_updateScrappedProducts()
 {
     if (!isset($_SESSION['sysUserId'])) {
         //检测用户是否登陆
         header('location:index.php?mod=login&act=index');
         exit;
     }
     $scrappedProductsAct = new ScrappedProductsAct();
     $scrappedId = isset($_GET['scrappedId']) ? post_check($_GET['scrappedId']) : '';
     if (empty($scrappedId)) {
         //为空时,跳转到列表页面,输出错误信息
         $status = '审核失败,id为空';
         header("location:index.php?mod=scrappedProducts&act=getScrappedProductsList&status={$status}");
         exit;
     }
     $now = time();
     $set = "SET scrappedStatus='1',processTime='{$now}' ";
     $where = "WHERE id='{$scrappedId}' ";
     $affectRow = $scrappedProductsAct->act_updateScrappedProducts($set, $where);
     if ($affectRow) {
         $status = '审核成功';
     } else {
         $status = '审核失败';
     }
     header("location:index.php?mod=scrappedProducts&act=getScrappedProductsList&status={$status}");
 }