Example #1
0
 public function update()
 {
     $id = Request::input('id');
     $adminBank = AdminBank::find($id);
     if (!$adminBank) {
         return failure('不存在该条记录');
     }
     if (!$adminBank->toggleStatus()) {
         return failure('修改状态失败');
     }
     return success('状态变更成功');
 }
Example #2
0
 public function addBank()
 {
     if (!Request::has('bank', 'name', 'account')) {
         return failure('参数错误');
     }
     $bank = Bank::find(Request::input('bank'));
     if (!$bank) {
         return failure('银行不存在');
     }
     $adminBank = AdminBank::add($bank, Request::input('name'), Request::input('account'), Request::input('address'));
     if (!$adminBank) {
         return failure('添加银行失败');
     }
     return success('添加银行成功');
 }
Example #3
0
 /**
  * 充值首页
  *  
  * @date   2015-10-07
  * @return [type]     [description]
  */
 public function index()
 {
     $data = [];
     $user = Auth::user();
     $banks = AdminBank::where('admin_banks.status', 1)->leftJoin('banks', 'admin_banks.bank_id', '=', 'banks.id')->orderBy('banks.sort', 'desc')->get();
     $data = ['banks' => $banks];
     return view('banks.index', $data);
 }