本文整理匯總了PHP中Base_model::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Base_model::get方法的具體用法?PHP Base_model::get怎麽用?PHP Base_model::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Base_model
的用法示例。
在下文中一共展示了Base_model::get方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_json
/**
* get_json 通過json獲得問題列表
* @param [type] $json [description]
* @param [type] $page [description]
* @param [type] $count [description]
* @return [type] [description]
*/
public function get_json($json, $page = 0, $count = 20)
{
$index = 0;
$returnData = array();
$json = json_decode($json);
$json = array_slice($json, $page, $count);
foreach ($json as $value) {
$data = parent::get(array('id' => $value));
$data['ctime'] = date("H:i:s", strtotime($data['ctime']));
@($data['tags'] = $this->tag_model->get_list_by_json($data['tags']));
$returnData[] = $data;
$index++;
}
return $returnData;
}
示例2: get_problem_json
}
public function get_problem_json($pid, $type = 'collect_problems')
{
$temp_collect = array();
$collect = json_decode($this->me[$type]);
foreach ($collect as $key => $value) {
if ($value->t != $pid) {
array_push($temp_collect, array("t" => $value->t));
示例3: remove
public function remove($id)
{
$course = parent::get(array('id' => $id));
$this->db->query('update user set god_course_count = god_course_count - 1 where id = ' . $course['god']);
parent::remove($id);
}
示例4: get_content
public function get_content($type)
{
return parent::get(array('type' => $type))['content'];
}
示例5: get
public function get($pk, $pot = '')
{
$this->switching($this->_idx_table, $pot);
return parent::get($pk);
}
示例6: add_active_user
}
return $result;
}
public function add_active_user($tag_id, $user_id, $is_god = false)
{
$type = $is_god ? 'active_god' : 'active_stu';
$tag = parent::get(array('id' => $tag_id));
$list = json_decode($tag[$type]);
if (!empty($list->{$user_id})) {
$list->{$user_id}++;
} else {
$list->{$user_id} = 1;
}
parent::edit($tag_id, array($type => json_encode($list)));
}
public function get_active_user($tag_id, $count = 5, $is_god = false)
{