本文整理汇总了PHP中Service::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Service::select方法的具体用法?PHP Service::select怎么用?PHP Service::select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service::select方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findOne
public function findOne($id)
{
$service = Service::select(array('services.id', 'outlet_id', 'services.name', 'price', 'active', 'time_operate', 'services.created_at', 'services.updated_at', 'service_details.summary', 'service_details.highlights', 'service_conditions.special_condition', 'service_conditions.condition1', 'service_conditions.condition2', 'condition_id', 'detail_id'))->leftJoin('service_details', 'service_details.id', '=', 'services.detail_id')->leftJoin('service_conditions', 'service_conditions.id', '=', 'services.condition_id')->where('services.id', $id)->first();
return $service;
}
示例2: listService
/**
* Display a listing of services
*
* @return Response
*/
public function listService()
{
$title = Lang::get('site/services/title.service_management');
$services = Service::select(array('services.*'))->active()->owner()->paginate(10);
return View::make('site.services.index', compact('services', 'title'));
}
示例3: editDeal
/**
* Show the form for editing the specified service.
*
* @param int $id
* @return Response
*/
public function editDeal($id)
{
$deal = Deal::find($id);
$services = Service::select(array('services.name', 'services.id'))->owner()->lists('name', 'id');
$dealType = array(DealRepository::DEAL_TYPE_HOT_DEAL => DealRepository::DEAL_TYPE_HOT_DEAL, DealRepository::DEAL_TYPE_SERVICE => DealRepository::DEAL_TYPE_SERVICE);
return View::make('site.deals.edit', compact('deal', 'services', 'dealType'));
}
示例4: editDeal
/**
* Show the form for editing the specified deal.
*
* @param int $id
* @return Response
*/
public function editDeal($id)
{
$title = 'Edit Deal';
$deal = Deal::find($id);
$services = Service::select(array('services.name', 'services.id'))->lists('name', 'id');
return View::make('admin.deals.edit', compact('deal', 'services', 'title'));
}
示例5:
<input id="image" type="file" name="image" placeholder="Imagem">
<input class="fields" type="text" name="title" placeholder="Nome do serviço">
<textarea class="fields" type="text" name="description" placeholder="Descrição do serviço"></textarea>
<button name="action" value="insert">INSERIR</button>
</form>
<?php
if (isset($_GET['id'])) {
?>
<h2>Atualizar serviço existente</h2>
<form action="../controllers/services.php" method="post" enctype="multipart/form-data">
<input id="image" name="image" type="file" value="<?php
echo $escolhido['image'];
?>
">
<?php
$escolhido = Service::select($_GET['id'], $connect);
?>
<input class="fields" name="title" type="text" value="<?php
echo $escolhido['title'];
?>
">
<textarea class="fields" name="description" type="text"><?php
echo $escolhido['description'];
?>
</textarea>
<input name="id" type="hidden" value="<?php
echo $escolhido['id'];
?>
">
<button name="action" value="update">EDITAR</button>
</form>