本文整理汇总了PHP中client::get_all_client方法的典型用法代码示例。如果您正苦于以下问题:PHP client::get_all_client方法的具体用法?PHP client::get_all_client怎么用?PHP client::get_all_client使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client
的用法示例。
在下文中一共展示了client::get_all_client方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content
public function content()
{
$data = $this->input['data'];
$content_client_relation = $data['content_client_relation'];
$content_relation = $data['content_relation'];
$content = $data['content'];
if (!$content_client_relation || !$content_relation || !$content) {
$this->errorOutput('NO_DATA');
}
$bundle_id = $content['bundle_id'];
$module_id = $content['module_id'];
$struct_id = $content['struct_id'];
//content process
$syn_content = $this->syn_obj->get_content_in_site($content['id'], $content['site_id']);
$update_contentarr = $content;
unset($update_contentarr['id']);
if ($syn_content) {
//struct_table update process
$this->struct($bundle_id, $module_id, $struct_id, $data, 'update', $syn_content['expand_id']);
unset($update_contentarr['syn_cid'], $update_contentarr['expand_id'], $update_contentarr['plan_set_id'], $update_contentarr['bundle_id'], $update_contentarr['module_id'], $update_contentarr['struct_id'], $update_contentarr['content_fromid']);
$this->obj->update('content', ' id=' . $syn_content['id'], $update_contentarr);
$content_id = $syn_content['id'];
} else {
//struct_table insert process
$update_contentarr['expand_id'] = $this->struct($bundle_id, $module_id, $struct_id, $data);
$update_contentarr['syn_cid'] = $content['id'];
$content_id = $this->obj->insert('content', $update_contentarr);
}
//content_relation process
$syn_content_relation = $this->syn_obj->get_content_relation_by_columnid($content_id, $content_relation['column_id']);
$update_content_relationarr = $content_relation;
unset($update_content_relationarr['id']);
if ($syn_content_relation) {
unset($update_content_relationarr['syn_rid'], $update_content_relationarr['content_id'], $update_content_relationarr['order_id'], $update_contentarr['bundle_id'], $update_contentarr['module_id'], $update_contentarr['struct_id']);
$this->obj->update('content_relation', ' id=' . $syn_content_relation['id'], $update_content_relationarr);
$content_relation_id = $syn_content_relation['id'];
} else {
$update_content_relationarr['syn_rid'] = $content_relation['id'];
$update_content_relationarr['content_id'] = $content_id;
$content_relation_id = $this->obj->insert('content_relation', $update_content_relationarr);
$this->obj->update('content_relation', ' id=' . $content_relation_id, array('order_id' => $content_relation_id));
//add content_client_relation
//get client
include CUR_CONF_PATH . 'lib/client.class.php';
$client_obj = new client();
$client_typearr = $client_obj->get_all_client();
foreach ($client_typearr as $kct => $vct) {
$content_client_data['client_type'] = $vct['id'];
$content_client_data['relation_id'] = $content_relation_id;
$this->obj->insert('content_client_relation', $content_client_data);
}
}
}
示例2: show
/**
* @Description : 获取发布库内容
* @Author : dong(dong@hoge.cn)
* @Category : publishcontent
* @Date : 2014-2-14
* @LastUpdateDate : 2014-2-14
* @Copyright : hogesoft
* @Param : site_id(站点id);column_id(栏目id,多个逗号隔开);client_type(终端id);
* @Return : json
*/
public function show()
{
$site_id = $column_id = '';
$content_data = array();
$id = urldecode($this->input['_id']);
$app = urldecode($this->input['con_app']) == 'all' ? '' : urldecode($this->input['con_app']);
//查询出站点下模块的内容
//$offset = $this->input['offset'] ? intval(urldecode($this->input['offset'])) : 0;
$page = $this->input['page'] ? intval(urldecode($this->input['page'])) : 1;
$count = $this->input['offset'] ? intval(urldecode($this->input['offset'])) : 20;
$offset = $count * ($page - 1);
$content_data = $this->obj->get_content_allinfo($this->get_condition(), $offset, $count, $this->other_field);
if ($content_data['col_id_str']) {
$col_parent = $this->column->get_col_parents($content_data['col_id_str']);
$column_datas = $this->column->get_column_by_id(' id,name,site_id,column_dir,relate_dir,fid,childdomain,father_domain,custom_content_dir,col_con_maketype ', $content_data['col_id_str'], 'id');
}
if ($content_data['site_id_arr']) {
$site_datas = $this->column->get_site(' id,site_name,weburl,sub_weburl,custom_content_dir ', ' AND id in(' . implode(',', $content_data['site_id_arr']) . ')', 'id');
}
unset($content_data['col_id_str']);
unset($content_data['site_id_arr']);
foreach ($content_data as $k => $v) {
$content_data[$k]['state'] = $v['status'];
if ($v['outlink']) {
$content_data[$k]['content_url'] = stripos($v['outlink'], 'http') === 0 ? $v['outlink'] : 'http://' . $v['outlink'];
} else {
$v['column_id'] = $v['use_maincolumn'] ? $v['main_column_id'] : $v['column_id'];
$content_data[$k]['content_url'] = mk_content_url($site_datas[$v['site_id']], $column_datas[$v['column_id']], $v);
}
}
//取出应用模块
$appdata = $this->obj->get_app();
$appchilddata = $this->obj->get_app_child($app);
//取出所有客户端
include_once CUR_CONF_PATH . 'lib/client.class.php';
$client_obj = new client();
$client = $client_obj->get_all_client('*', '', 'id');
$sql = "SELECT COUNT(*) AS total" . $this->other_field . " FROM " . DB_PREFIX . "content_client_relation cr LEFT JOIN " . DB_PREFIX . "content_relation r ON cr.relation_id=r.id WHERE 1 " . $this->get_condition();
$pagearr = $this->db->query_first($sql);
$pagearr['offset'] = $count;
$pagearr['count'] = $count;
$pagearr['total_page'] = ceil($pagearr['total'] / $count);
$pagearr['current_page'] = floor($offset / $count) + 1;
$alldata['content_data'] = $content_data;
$alldata['col_parent'] = $col_parent;
$alldata['app_data'] = $appdata;
$alldata['appchild_data'] = $appchilddata;
$alldata['client'] = $client;
$alldata['page'] = $pagearr;
$this->addItem($alldata);
$this->output();
}