本文整理汇总了PHP中app\Activity::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Activity::orderBy方法的具体用法?PHP Activity::orderBy怎么用?PHP Activity::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Activity
的用法示例。
在下文中一共展示了Activity::orderBy方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAdd
public function getAdd(Request $request)
{
$lastActivity = Activity::orderBy('created_at', 'DESC')->first();
$perpage = 12;
$imgs = Img::where('img_block', '=', 'public')->orderBy('created_at', 'DESC')->simplePaginate($perpage);
return view('manage.activity.add', ['TITLE' => '新增活动', 'META_KEYWORDS' => META_KEYWORDS, 'META_DESC' => META_DESC, 'PAGE_CODE' => '/manage/activity/add', 'lastActivity' => $lastActivity, 'imgs' => $imgs]);
}
示例2: orderBy
public function orderBy($column)
{
return \App\Activity::orderBy($column)->get();
}
示例3: activity
public function activity()
{
if ($this->data['user']['level'] > 1) {
$this->data['activities'] = Activity::orderBy('created_at', 'desc')->paginate('10');
} else {
$this->data['activities'] = Activity::where('user', $this->data['user']['id'])->where('level', 0)->orderBy('created_at', 'desc')->paginate('10');
}
return view('home.activity', $this->data);
}
示例4: data
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function data()
{
$etapas = stage::orderBy('name', 'DESC')->get();
$actividades = Activity::orderBy('name', 'DESC')->get();
return response()->json(['etapas' => $etapas, 'actividades' => $actividades]);
}
示例5: getAllActivities
public function getAllActivities()
{
return Activity::orderBy('activity')->get();
}
示例6: proyecto
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function proyecto($id)
{
$etapas = stage::join('project_stage', 'project_stage.stage_id', '=', 'stages.id')->join('projects', 'projects.id', '=', 'project_stage.project_id')->where('projects.id', '=', $id)->get(['stages.*']);
$actividades = Activity::orderBy('name', 'asc')->get();
return response()->json(['etapas' => $etapas, 'actividades' => $actividades]);
}
示例7: processMaintenanceFormView
public function processMaintenanceFormView()
{
$activity = Session::get('activity');
$items = Item::lists('name', 'id')->sort();
$old_maintenance = Session::get('maintenance');
if ($old_maintenance == null) {
$maintenance = new Maintenance();
$maintenance->activity_id = $activity->id;
$maintenance->save();
Session::put('maintenance', $maintenance);
} else {
$maintenance = $old_maintenance;
}
$costs = Maintenance::find($maintenance->id)->items;
$activities = Activity::orderBy('created_at', 'desc')->take(10)->get();
return view('home', ['type' => '2', 'activity' => $activity, 'activities' => $activities, 'items' => $items, 'maintenance_id' => $maintenance->id, 'costs' => $costs]);
// Session::forget('activity');
// return view('home', [ 'type'=> '2', 'activity' => $activity, 'activities' => $activities]);
}