Example #1
0
 public function getFeeTrade($market_id)
 {
     $fee_trade = FeeTrade::where('market_id', '=', $market_id)->first();
     if (isset($fee_trade->fee_buy)) {
         return array('fee_buy' => $fee_trade->fee_buy, "fee_sell" => $fee_trade->fee_sell);
     } else {
         return array('fee_buy' => 0, "fee_sell" => 0);
     }
 }
 public function deleteMarket()
 {
     $market_id = Input::get('market_id');
     $market = Market::find($market_id);
     if (isset($market->id)) {
         FeeTrade::where('market_id', $market_id)->delete();
         Order::where('market_id', $market_id)->delete();
         Trade::where('market_id', $market_id)->delete();
         Market::where('id', $market_id)->delete();
         $message = Lang::get('admin_messages.delete_success');
         if (Input::get('isAjax')) {
             echo json_encode(array('status' => 'success', 'message' => $message));
             exit;
         } else {
             return Redirect::to('admin/manage/markets')->with('success', $message);
         }
     } else {
         $message = Lang::get('admin_messages.market_not_exist');
         if (Input::get('isAjax')) {
             echo json_encode(array('status' => 'error', 'message' => $message));
             exit;
         } else {
             return Redirect::to('admin/manage/markets')->with('error', $message);
         }
     }
 }