本文整理汇总了PHP中BaseModel::selectSingle方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseModel::selectSingle方法的具体用法?PHP BaseModel::selectSingle怎么用?PHP BaseModel::selectSingle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseModel
的用法示例。
在下文中一共展示了BaseModel::selectSingle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selectForDetail
public function selectForDetail($id)
{
$this->mapping->fields['id'] = 'typeID';
$this->mapping->fields['title'] = 'typeTitle';
$this->mapping->fields['parent'] = 'typeParentID';
$this->mapping->criterias['id'] = new stdclass();
$this->mapping->criterias['id']->field = 'typeID';
$this->mapping->criterias['id']->operator = '=';
$this->mapping->criterias['id']->value = $id;
return parent::selectSingle($id);
}
示例2: selectForInfo
public function selectForInfo($id)
{
$this->mapping->table .= " AS mainTable";
$this->mapping->fields['infoName'] = 'CONCAT(accountFirstName,"",acountLastName)';
$this->mapping->fields['createdAt'] = 'createdAt';
$this->mapping->fields['updatedBy'] = '(SELECT userLogin FROM users WHERE userID = mainTable.updatedBy)';
$this->mapping->fields['updatedAt'] = 'updatedAt';
$this->mapping->criterias['id'] = new stdclass();
$this->mapping->criterias['id']->field = 'accountID';
$this->mapping->criterias['id']->operator = '=';
$this->mapping->criterias['id']->value = $id;
$row = parent::selectSingle($data);
$this->mapping->table = str_replace(" AS mainTable", "", $this->mapping->table);
return $row;
}
示例3: selectForDetail
public function selectForDetail($id)
{
$this->mapping->fields['id'] = 'brandID';
$this->mapping->fields['title'] = 'brandTitle';
$this->mapping->fields['album'] = 'albumID';
$this->mapping->criterias['id'] = new stdclass();
$this->mapping->criterias['id']->field = 'brandID';
$this->mapping->criterias['id']->operator = '=';
$this->mapping->criterias['id']->value = $id;
$data = parent::selectSingle($id);
// Recupera fotos a partir do album
if ($this->photoModel && $data) {
$data->photos = $this->photoModel->selectAlbum($data->album);
}
return $data;
}
示例4: checkLogin
public function checkLogin($data)
{
$this->mapping->fields['id'] = 'userID';
$this->mapping->fields['name'] = 'userName';
$this->mapping->fields['blocked'] = 'userBlocked';
$this->mapping->criterias['user'] = new stdclass();
$this->mapping->criterias['user']->field = 'userLogin';
$this->mapping->criterias['user']->operator = '=';
$this->mapping->criterias['user']->value = $data->user;
$this->mapping->criterias['password'] = new stdclass();
$this->mapping->criterias['password']->field = 'userPassword';
$this->mapping->criterias['password']->operator = '=';
$this->mapping->criterias['password']->value = md5($data->password);
return parent::selectSingle($data);
}