示例#1
0
 public static function doveonline($vedo, $tinh, $ngay)
 {
     $model = "KqxsNam";
     if ($tinh >= 21 && $tinh <= 26) {
         $model = "KqxsBac";
     }
     if ($tinh > 26) {
         $model = "KqxsTrung";
     }
     $tongtien = 0;
     $giaitrung = array();
     $kq = $model::model()->find("date = :date and provice=:province", array(":date" => $ngay, ":province" => $tinh));
     if (!$kq) {
         return false;
     }
     if ($model == "KqxsBac") {
         //kqxs mien bac
         if (CommonHelper::giai7_bac($vedo, $kq)) {
             $tongtien += 25000;
             array_push($giaitrung, "7");
         }
         if (CommonHelper::giai6_bac($vedo, $kq)) {
             $tongtien += 50000;
             array_push($giaitrung, "6");
         }
         if (CommonHelper::giai5_bac($vedo, $kq)) {
             $tongtien += 100000;
             array_push($giaitrung, "5");
         }
         if (CommonHelper::giai4_bac($vedo, $kq)) {
             $tongtien += 200000;
             array_push($giaitrung, "5");
         }
         if (CommonHelper::giai3_bac($vedo, $kq)) {
             $tongtien += 1000000;
             array_push($giaitrung, "3");
         }
         if (CommonHelper::giai2_bac($vedo, $kq)) {
             $tongtien += 2500000;
             array_push($giaitrung, "2");
         }
         if (CommonHelper::giai1_bac($vedo, $kq)) {
             $tongtien += 10000000;
             array_push($giaitrung, "1");
         }
         if (CommonHelper::giaidb_bac($vedo, $kq)) {
             $tongtien += 75000000;
             array_push($giaitrung, "Đặc Biệt");
         } else {
             if (CommonHelper::giaikk_bac($vedo, $kq)) {
                 $tongtien += 25000;
                 array_push($giaitrung, "Khuyến Khích");
             }
         }
     } else {
         //kqxs mien trung & mien nam
         if (CommonHelper::giai8_nam($vedo, $kq)) {
             $tongtien += 100000;
             array_push($giaitrung, "8");
         }
         if (CommonHelper::giai7_nam($vedo, $kq)) {
             $tongtien += 200000;
             array_push($giaitrung, "7");
         }
         if (CommonHelper::giai6_nam($vedo, $kq)) {
             $tongtien += 400000;
             array_push($giaitrung, "6");
         }
         if (CommonHelper::giai5_nam($vedo, $kq)) {
             $tongtien += 1000000;
             array_push($giaitrung, "5");
         }
         if (CommonHelper::giai4_nam($vedo, $kq)) {
             $tongtien += 3000000;
             array_push($giaitrung, "4");
         }
         if (CommonHelper::giai3_nam($vedo, $kq)) {
             $tongtien += 10000000;
             array_push($giaitrung, "3");
         }
         if (CommonHelper::giai2_nam($vedo, $kq)) {
             $tongtien += 20000000;
             array_push($giaitrung, "2");
         }
         if (CommonHelper::giai1_nam($vedo, $kq)) {
             $tongtien += 30000000;
             array_push($giaitrung, "1");
         }
         if (CommonHelper::giaidb_nam($vedo, $kq)) {
             $tongtien += 1500000000;
             array_push($giaitrung, "Đặc Biệt");
         } else {
             if (CommonHelper::giaikkdb_nam($vedo, $kq)) {
                 $tongtien += 100000000;
                 array_push($giaitrung, "Đặc Biệt phụ");
             } else {
                 if (CommonHelper::giaikk_nam($vedo, $kq)) {
                     $tongtien += 6000000;
                     array_push($giaitrung, "Khuyến Khích");
                 }
             }
         }
     }
     return array("tongtien" => $tongtien, "giai" => $giaitrung);
 }