コード例 #1
0
 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
0
ファイル: ORM.php プロジェクト: brussens/cogear2
 /**
  * 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
0
ファイル: UserinfoModel.class.php プロジェクト: kevicki/pig
	/**
	 * 重置附属表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
0
ファイル: TabsControl.php プロジェクト: soundake/pd
 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
0
ファイル: Repository.php プロジェクト: puggin/pugs
 /**
  * Gets an entity by parameters
  *
  * @param array $params
  * @return array
  */
 public function get(array $params)
 {
     return $this->entity->where($params)->get();
 }
コード例 #6
0
 public function index()
 {
     JavaScript::put(['bannerImages' => Object::where('type', MissionControlType::Image)->get(), 'dataViews' => DataView::all()->toArray()]);
     return view('missionControl.dataviews.index');
 }
コード例 #7
0
 /**
  * 使用 粉丝组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();
 }