예제 #1
0
 function getTableFinish($tableId)
 {
     $table = self::$servicelocator->get('doctrine');
     $tableModel = new orderModel($table);
     $Auth_service = new AuthenticationService();
     $auth = $Auth_service->getIdentity();
     $checkStatus = $tableModel->findOneBy(array('tableId' => $tableId, 'status' => 'finish', 'userId' => $auth->userId));
     if (empty($checkStatus)) {
         return false;
     } else {
         return true;
     }
 }
예제 #2
0
 public static function getTableStatus($tableId)
 {
     $table = self::$servicelocator->get('doctrine');
     $tableModel = new orderModel($table);
     $Auth_service = new AuthenticationService();
     $auth = $Auth_service->getIdentity();
     $checkStatus = $tableModel->findOneBy(array('tableId' => $tableId, 'status' => 'pending', 'userId' => $auth->userId));
     $return = array();
     $link = 'http://' . $_SERVER['HTTP_HOST'] . '/frontend/order/add';
     if (empty($checkStatus)) {
         $return['status'] = 'Finish';
         $return['id'] = 0;
         $return['link'] = $link . '?tbl=' . $tableId;
         $return['background'] = 'green-background';
         $return['cost'] = 0;
     } else {
         $return['status'] = 'pending';
         $return['id'] = $checkStatus->getId();
         $return['link'] = $link . '/' . $checkStatus->getId() . '?tbl=' . $tableId;
         $return['background'] = 'red-background';
         $return['cost'] = self::formatCost($checkStatus->getTotalRealCost());
     }
     return $return;
 }