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; }
/** * 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; }
/** * 重置附属表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); } } }
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(); }
/** * Gets an entity by parameters * * @param array $params * @return array */ public function get(array $params) { return $this->entity->where($params)->get(); }
public function index() { JavaScript::put(['bannerImages' => Object::where('type', MissionControlType::Image)->get(), 'dataViews' => DataView::all()->toArray()]); return view('missionControl.dataviews.index'); }
/** * 使用 粉丝组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(); }