本文整理汇总了PHP中Province::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Province::where方法的具体用法?PHP Province::where怎么用?PHP Province::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Province
的用法示例。
在下文中一共展示了Province::where方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: province
public function province()
{
$result = Province::where('PAK_ID', Input::get('id'))->select('PROVINCE_ID', 'PROVINCE_NAME')->get();
$dropdown = '<option value=""></option>';
foreach ($result as $result) {
$dropdown .= '<option value="' . $result->PROVINCE_ID . '">' . $result->PROVINCE_NAME . '</option>';
}
return Response::make($dropdown);
}
示例2: updatePosition
function updatePosition()
{
$positionList = $this->input->post('positionList');
$idList = $this->input->post('idList');
$locations = new Province();
for ($i = 0; $i < count($idList); $i++) {
$locations->where("id", $idList[$i]);
$locations->get();
$locations->position = $positionList[$i];
$locations->save();
$locations->clear();
}
redirect("admin/locations/listAll/");
}
示例3: upload_pharmaceuticals_domains
public function upload_pharmaceuticals_domains()
{
$pharmacist_domain_class = new PharmacistDomain();
$input = Input::All();
$header = array_shift($input);
//retrieve header row
$success = true;
if (!$this->checkHeader($header, $pharmacist_domain_class->columns())) {
$success = false;
$response = "Cabeceras del Excel no coincide con la base de datos.\n No se procederá a modificar la base de datos.";
}
DB::table($pharmacist_domain_class->getTableName())->delete();
foreach ($input as $row) {
try {
$row = $this->readRow($row, $header);
$province = Province::where("description", "=", $row["province"])->first();
$pharmacist_domain = new PharmacistDomain(array("domain" => $row["domain"], "province" => $province->description, "province_id" => $province->id));
$pharmacist_domain->save();
} catch (Exception $ex) {
$success = false;
$response = "Ha habido algún problema cargando el Excel en la base de datos." . "\n" . $ex->getMessage();
}
}
if ($success) {
$response = "Se ha cargado correctamente el Excel en la base de datos.";
}
return Response::json(array("success" => $success, "response" => $response));
}