本文整理汇总了PHP中Object::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Object::where方法的具体用法?PHP Object::where怎么用?PHP Object::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Object
的用法示例。
在下文中一共展示了Object::where方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFloorplan
public function getFloorplan($id = null)
{
if ($id) {
$object = Object::where('id', '=', $id)->get();
$objectImage = ObjectImage::where('object_id', '=', $id)->get();
}
$data = array('floor_pdf' => $object[0]->floor_plan_link, 'floor_img' => $objectImage[0]->image_name);
echo json_encode($data);
die;
}
示例2: findAll
/**
* Find all
*
* @return object/NULL
*/
public function findAll()
{
if ($this->object) {
$this->db->where($this->getData());
}
if ($result = $this->db->get($this->table)->result()) {
foreach ($result as &$element) {
event('Db_ORM.findAll', $this, $result);
$this->cache($element->{$this->primary}, $element);
$element = $this->filterData($element, self::FILTER_OUT);
}
$this->clear();
}
return $result;
}
示例3: convertFake
/**
* 重置附属表wecha_id
* @param Object $model
* @param Array $params
*/
public function convertFake($model, $params) {
if (count($params) > 3) {
exit('param error');
}
foreach ($params as $key => $value) {
if ('token' == $key || 'fakeopenid' == $key) continue;
$field = $key;
$wecha_id = $value;
}
$token = $params['token'];
$fakeopenid = $params['fakeopenid'];
if ($this->isSub($token, $wecha_id) && $wecha_id != $fakeopenid) {
if (!empty($fakeopenid)) {
$model->where(array('token'=>$token, $field=>$fakeopenid))->setField($field, $wecha_id);
}
}
}
示例4: handleFree
public function handleFree()
{
$this->tab = 'free';
$this->events->where('id', $this->context->database->table('event_x_category')->select('event_id')->where('category_id', '1'))->limit(10);
$this->refresh();
}
示例5: get
/**
* Gets an entity by parameters
*
* @param array $params
* @return array
*/
public function get(array $params)
{
return $this->entity->where($params)->get();
}
示例6: index
public function index()
{
JavaScript::put(['bannerImages' => Object::where('type', MissionControlType::Image)->get(), 'dataViews' => DataView::all()->toArray()]);
return view('missionControl.dataviews.index');
}
示例7: getGroupByGroupid
/**
* 使用 粉丝组group_id 查找分组.
*
* @param Int $accountId Account ID
* @param Int $groupId 粉丝组自增ID
*
* @return Object
*/
public function getGroupByGroupid($accountId, $groupId)
{
return $this->model->where('account_id', $accountId)->where('group_id', $groupId)->first();
}