本文整理汇总了PHP中Club::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Club::where方法的具体用法?PHP Club::where怎么用?PHP Club::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Club
的用法示例。
在下文中一共展示了Club::where方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
// listItem : nom de la procedure dans le model
$listItem = 'newListItem';
// Clubs déjà selectionnes
$clubExistes = Confide::user()->getListClubId();
// Datas - cherche par Nom
if ($inputs['nom'] == 'parNom') {
$datas = Club::where('nom', 'LIKE', '%' . $inputs['search'] . '%')->where('id', '>', 1)->whereNotIn('id', $clubExistes)->orderBy('nom', 'ASC')->get();
}
// Datas - cherche par Region
if ($inputs['nom'] == 'parRegion') {
$datas = Club::whereRegionId($inputs['search'])->where('id', '>', 1)->whereNotIn('id', $clubExistes)->orderBy('nom', 'ASC')->get();
}
// Limit datas to show : if 0 or not exist then value no limit
$param['maxData'] = '60';
// Sub-titre
$param['sub-titre'] = 'Sélectionnez un club';
// Select Route
$param['selectRoute'] = 'userclub.add';
$param['selectText'] = '';
// Actions
$param['actions'] = 'select';
// BackUrl
$param['backUrl'] = 'manager';
?>
<!-- List.Blade -->
<div class="information white">
示例2: function
$code .= '<option value="' . $result->id . '">' . $result->libelle . '</option>';
}
return $code;
});
# SelectBox Regions
Route::post('sbRegions/{nation_id}', function ($nation_id) {
$results = Region::where('nation_id', '=', $nation_id)->get();
$code = '';
foreach ($results as $result) {
$code .= '<option value="' . $result->id . '">' . $result->libelle . '</option>';
}
return $code;
});
# SelectBox Clubs
Route::post('sbClubs/{region_id}', function ($region_id) {
$results = Club::where('region_id', '=', $region_id)->get();
$code = '';
foreach ($results as $result) {
$code .= '<option value="' . $result->id . '">' . $result->nom . '</option>';
}
return $code;
});
# LoadPage
Route::post('loadpage', function () {
if (Request::ajax()) {
$inputs = Input::all();
$module = Input::get('page');
return View::make($module)->with(['inputs' => $inputs]);
}
});
});
示例3: saveClubInfo
private function saveClubInfo($user)
{
$title = Input::get('club_title', '');
$brief = Input::get('club_brief', '');
$img_token = Input::get('img_token_2', '');
if ($title) {
$club = Club::where('u_id', '=', $user->u_id)->first();
if (empty($club)) {
$club = new Club();
$club->u_id = $user->u_id;
$club->s_id = $user->u_school_id;
$club->c_title = $title;
$club->addClub();
}
$club->c_title = $title;
$club->c_brief = $brief;
$c_id = $club->c_id;
$imgObj = new Img('club', $img_token);
$club->c_imgs = $imgObj->getSavedImg($c_id, $club->c_imgs);
$club->save();
}
return true;
}
示例4: censorUserProfileClub
public function censorUserProfileClub($id)
{
$check = Input::get('check');
$remark = Input::get('remark');
try {
$club = Club::where('u_id', '=', $id)->first();
if (empty($club)) {
throw new Exception("该用户没有可用的社团", 10001);
}
if ($check == 1) {
$club->c_status = 1;
$club->u_is_club_verified = 1;
} else {
$club->c_status = 2;
$club->u_is_club_verified = 0;
}
$club->remark = $remark;
$club->censor();
$re = Tools::reTrue('审核社团信息成功');
} catch (Exception $e) {
$re = Tools::reFalse($e->getCode(), '审核社团信息失败:' . $e->getMessage());
}
return Response::json($re);
}
示例5: listClubsOneRegion
/**
* @param $region_id
* @return mixed
*/
public static function listClubsOneRegion($region_id)
{
return Club::where('region_id', '=', $region_id)->lists('nom', 'id');
}