本文整理汇总了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)
{