本文整理汇总了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);
}
示例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');
}
示例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'));
}