当前位置: 首页>>代码示例>>PHP>>正文


PHP Discount::find方法代码示例

本文整理汇总了PHP中Discount::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Discount::find方法的具体用法?PHP Discount::find怎么用?PHP Discount::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Discount的用法示例。


在下文中一共展示了Discount::find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Edit

 public function Edit()
 {
     $input = Input::all();
     $discount_id = $input['id'];
     $role = $this->role->GetAllRoleAgent();
     $listBranch = $this->branch->GetAllBranch();
     $discount = Discount::find($discount_id);
     return View::make('admin.discount.add')->with('discount', $discount)->with('role', $role)->with('listBranch', $listBranch);
 }
开发者ID:hungleon2112,项目名称:giaymaster,代码行数:9,代码来源:DiscountController.php

示例2: getDeletediscount

 public function getDeletediscount($id)
 {
     $discount = Discount::find($id);
     // No such id
     if ($discount == null) {
         $errors = new \Illuminate\Support\MessageBag();
         $errors->add('deleteError', "The discount may have been deleted.");
         return \Redirect::to('admin/pricelists')->withErrors($errors)->withInput();
     }
     $discount->delete();
     return \Redirect::to('admin/pricelists');
 }
开发者ID:tusharvikky,项目名称:redminportal,代码行数:12,代码来源:PricelistController.php

示例3: reductionsFilter

 public function reductionsFilter($types, $id)
 {
     $reductable_type = $types;
     $reduction_id = $id;
     $reductions = Reduction::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('reductable_type', '=', $reductable_type)->where('reductable_id', '=', $reduction_id)->get();
     switch ($reductable_type) {
         case 'Promotion':
             $discounts = Promotion::where('project_id', '=', Auth::user()->curr_project_id)->get();
             $discount = Promotion::find($reduction_id);
             break;
         case 'Voucher':
             $discounts = Voucher::where('project_id', '=', Auth::user()->curr_project_id)->get();
             $discount = Voucher::find($reduction_id);
             break;
         case 'Discount':
             $discounts = Discount::all();
             $discount = Discount::find($reduction_id);
             break;
         case 'Charge':
             $discounts = Charge::where('project_id', '=', Auth::user()->curr_project_id)->get();
             $discount = Charge::find($reduction_id);
             break;
         default:
             $discounts = Promotion::where('project_id', '=', Auth::user()->curr_project_id)->get();
             $discount = Promtion::find($reduction_id);
             break;
     }
     $menu = 'report';
     return View::make('reports.reductions', compact('reductable_type', 'reduction_id', 'reductions', 'discounts', 'discount', 'menu'));
 }
开发者ID:emanmks,项目名称:oneschool,代码行数:30,代码来源:ReportsController.php


注:本文中的Discount::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。