本文整理汇总了PHP中kekezu::get_arr_by_key方法的典型用法代码示例。如果您正苦于以下问题:PHP kekezu::get_arr_by_key方法的具体用法?PHP kekezu::get_arr_by_key怎么用?PHP kekezu::get_arr_by_key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kekezu
的用法示例。
在下文中一共展示了kekezu::get_arr_by_key方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getWorkInfo
public function getWorkInfo($w = array(), $p = array())
{
global $kekezu, $_K, $uid;
$work_arr = array();
$sql = " select a.*,b.seller_credit,b.seller_good_num,b.seller_total_num,b.seller_level,c.quote,c.quote_desc,c.cycle from " . TABLEPRE . "witkey_task_work a left join " . TABLEPRE . "witkey_space b on a.uid=b.uid\n\t\t\t\tleft join " . TABLEPRE . "witkey_task_match_work c on a.work_id=c.work_id";
$count_sql = " select count(a.work_id) from " . TABLEPRE . "witkey_task_work a left join " . TABLEPRE . "witkey_space b on a.uid=b.uid";
$where = " where a.task_id = '{$this->_task_id}' ";
if (!empty($w)) {
$intWorkStatus = intval($w['work_status']);
switch ($intWorkStatus) {
case '2':
$where .= " and a.is_view !=1 ";
break;
case '4':
case '7':
case '9':
$where .= " and a.work_status = '" . $intWorkStatus . "'";
break;
case '11':
$where .= " and a.uid = '{$this->_uid}'";
break;
}
}
$where .= " order by a.work_status asc,work_time desc";
if (!empty($p)) {
$page_obj = $kekezu->_page_obj;
$page_obj->setAjax(1);
$page_obj->setAjaxDom("gj_summery");
$count = intval(db_factory::get_count($count_sql . $where));
$pages = $page_obj->getPages($count, $p['page_size'], $p['page'], $p['url'], $p['anchor']);
$pages['count'] = $count;
$where .= $pages['where'];
}
$work_info = db_factory::query($sql . $where);
$work_info = kekezu::get_arr_by_key($work_info, 'work_id');
$arrWorks['work_info'] = array();
if (is_array($work_info)) {
foreach ($work_info as $k => $v) {
$arrWorks['work_info'][$k] = $v;
$arrWorks['work_info'][$k]['comment'] = $this->get_comment('work', $this->_task_id, $v['work_id'], $v['uid']);
}
}
$arrWorks['pages'] = $pages;
$strWorkIds = implode(',', array_keys($work_info));
$arrWorks['mark'] = $this->has_mark($strWorkIds);
$arrWorks['count'] = $count;
$strWorkIds && $uid == $this->_task_info['uid'] and db_factory::execute('update ' . TABLEPRE . 'witkey_task_work set is_view=1 where work_id in (' . $strWorkIds . ') and is_view=0');
return $arrWorks;
}
示例2: get_work_info
public function get_work_info($w = array(), $order = null, $p = array())
{
global $kekezu, $_K, $uid, $gUid;
$work_arr = array();
$sql = " select a.*,\n\t\t\t\t\t\tb.seller_credit,b.seller_good_num,b.residency,b.seller_total_num,b.seller_level\n\t\t\t\t\tfrom " . TABLEPRE . "witkey_task_work a\n\t\t\t left join " . TABLEPRE . "witkey_space b on a.uid=b.uid";
$count_sql = " select count(a.work_id) from " . TABLEPRE . "witkey_task_work a left join " . TABLEPRE . "witkey_space b on a.uid=b.uid";
$where = " where a.task_id = " . $this->_task_id;
if (!empty($w)) {
$intWorkStatus = intval($w['work_status']);
switch ($intWorkStatus) {
case '2':
$where .= " and a.is_view !=1 ";
break;
case '4':
case '5':
case '7':
case '8':
$where .= " and a.work_status = '" . $intWorkStatus . "'";
break;
case '9':
$where .= " and a.uid = '{$this->_uid}'";
break;
}
}
$where .= " order by field(a.work_status,'8','7','5','4') desc, work_id asc ";
if (!empty($p)) {
$page_obj = $kekezu->_page_obj;
$page_obj->setAjax(1);
$page_obj->setAjaxDom("gj_summery");
$count = intval(db_factory::get_count($count_sql . $where));
$pages = $page_obj->getPages($count, $p['page_size'], $p['page'], $p['url'], $p['anchor']);
$where .= $pages['where'];
$pages['count'] = $count;
}
$work_info = db_factory::query($sql . $where);
$work_info = kekezu::get_arr_by_key($work_info, 'work_id');
$work_arr['work_info'] = $work_info;
$work_arr['pages'] = $pages;
$work_ids = implode(',', array_keys($work_info));
$work_arr['mark'] = $this->has_mark($work_ids);
$work_arr['count'] = $count;
if (is_array($work_info)) {
foreach ($work_info as $k => $v) {
$work_arr['work_info'][$k] = $v;
$work_arr['work_info'][$k]['attachment'] = array();
if ($v['work_file']) {
$fileids = explode(',', $v['work_file']);
$fileids = array_filter($fileids);
$fileids = implode(',', $fileids);
$work_arr['work_info'][$k]['attachment'] = db_factory::query('select file_id,save_name,file_name from ' . TABLEPRE . 'witkey_file where file_id in (' . $fileids . ')');
}
$work_arr['work_info'][$k]['comment'] = $this->get_comment('work', $this->_task_id, $v['work_id'], $v['uid']);
if ($this->_task_status == 4) {
$arrVote = db_factory::get_count(sprintf(" select count(vote_id) from %switkey_vote where\n\t\t work_id='%d' and uid='%d' and vote_ip='%s'", TABLEPRE, intval($v['work_id']), $this->_uid, kekezu::get_ip()));
if ($arrVote) {
$work_arr['work_info'][$k]['vote'] = true;
}
unset($arrVote);
}
$arrFavorite = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and obj_id = %d and keep_type = "work"', TABLEPRE . 'witkey_favorite', intval($gUid), intval($v['work_id'])));
if ($arrFavorite) {
$work_arr['work_info'][$k]['favorite'] = true;
}
unset($arrFavorite);
}
}
$work_ids && $uid == $this->_task_info['uid'] and db_factory::execute('update ' . TABLEPRE . 'witkey_task_work set is_view=1 where work_id in (' . $work_ids . ') and is_view=0');
return $work_arr;
}
示例3: getWorkInfo
public function getWorkInfo($w = array(), $p = array())
{
global $kekezu, $uid;
$arrWorks = array();
$strSql = " select a.*,b.seller_credit,b.seller_good_num,b.seller_total_num,b.seller_level from " . TABLEPRE . "witkey_task_bid a left join " . TABLEPRE . "witkey_space b on a.uid=b.uid";
$strWhere = " where a.task_id = '{$this->_task_id}' ";
if (!empty($w)) {
$intBidStatus = intval($w['bid_status']);
switch ($intBidStatus) {
case '2':
$strWhere .= " and a.is_view !=1 ";
break;
case '4':
case '7':
$strWhere .= " and a.bid_status = '" . $intBidStatus . "'";
break;
case '9':
$strWhere .= " and a.uid = '{$this->_uid}'";
break;
}
}
$strWhere .= " order by field(a.bid_status,'8','7','4') desc, bid_id asc ";
if (!empty($p)) {
$objPage = $kekezu->_page_obj;
$objPage->setAjax(1);
$objPage->setAjaxDom("gj_summery");
$intCount = intval(db_factory::execute($strSql . $strWhere));
$strPages = $objPage->getPages($intCount, $p['page_size'], $p['page'], $p['url'], $p['anchor']);
$strPages['count'] = $intCount;
$strWhere .= $strPages['where'];
}
$arrWorkInfo = db_factory::query($strSql . $strWhere);
$arrWorkInfo = kekezu::get_arr_by_key($arrWorkInfo, 'bid_id');
$arrWorks['work_info'] = array();
if (is_array($arrWorkInfo)) {
foreach ($arrWorkInfo as $k => $v) {
$arrWorks['work_info'][$k] = $v;
$arrWorks['work_info'][$k]['comment'] = $this->get_comment('work', $this->_task_id, $v['bid_id'], $v['uid']);
}
}
$arrWorks['pages'] = $strPages;
$strWorkIds = implode(',', array_keys($arrWorkInfo));
$arrWorks['mark'] = $this->has_mark($strWorkIds);
$arrWorks['count'] = $intCount;
$strWorkIds && $uid == $this->_task_info['uid'] and db_factory::execute('update ' . TABLEPRE . 'witkey_task_bid set is_view=1 where bid_id in (' . $strWorkIds . ') and is_view=0');
return $arrWorks;
}
示例4: init_model
function init_model()
{
$model_arr = db_factory::query('select * from ' . TABLEPRE . 'witkey_model where 1=1 order by model_id asc', 0, null);
$this->_model_list = kekezu::get_arr_by_key($model_arr, 'model_id');
foreach ($this->_model_list as $v) {
if ($v['model_type'] == 'task') {
$this->_task_open = $this->_task_open | $v['model_status'];
} else {
$this->_shop_open = $this->_shop_open | $v['model_status'];
}
}
$route = $this->_route;
foreach ($route as $k => $v) {
if ($this->_task_open == 0) {
if (strpos($v, 'task') !== FALSE || $v == 'weibo') {
unset($route[$k]);
}
}
if ($this->_shop_open == 0) {
if (strpos($v, 'shop') !== FALSE || $v == 'seller_list') {
unset($route[$k]);
}
}
if ($this->_shop_open == 0 && $this->_task_open == 0) {
if ($v == 'case') {
unset($route[$k]);
}
}
}
$this->_route = $route;
$this->nav_filter();
}
示例5: get_auth
public static function get_auth($user_info)
{
$auth_item = keke_auth_base_class::get_auth_item();
$auth_temp = array_keys($auth_item);
$user_info['user_type'] == 2 and $un_code = 'realname' or $un_code = "enterprise";
$t = implode(",", $auth_temp);
$auth_info = db_factory::query(" select a.auth_code,a.auth_status,b.auth_title,b.auth_small_ico,b.auth_small_n_ico from " . TABLEPRE . "witkey_auth_record a left join " . TABLEPRE . "witkey_auth_item b on a.auth_code=b.auth_code where a.uid ='" . $user_info['uid'] . "' and FIND_IN_SET(a.auth_code,'{$t}')", 1, -1);
$auth_info = kekezu::get_arr_by_key($auth_info, "auth_code");
return array('item' => $auth_item, 'info' => $auth_info, 'code' => $un_code);
}
示例6: sprintf
$service = db_factory::query($sql . $s_sql . $f_sql . ' group by model_id', 1, 3600);
$payitem = db_factory::get_one($sql . sprintf(' from %switkey_finance where fina_type="out"
and fina_action="payitem" ', TABLEPRE) . $f_sql, 1, 3600);
break;
case 'profit':
$sql = sprintf(' select sum(site_profit) c from %switkey_finance where site_profit>0 ', TABLEPRE);
$task = db_factory::get_count($sql . ' and obj_type="task" ' . $f_sql, 0, 'c', 3600);
$service = db_factory::get_count($sql . ' and obj_type="service" ' . $f_sql, 0, 'c', 3600);
$payitem = db_factory::get_count($sql . ' and obj_type="payitem" ' . $f_sql, 0, 'c', 3600);
$auth = db_factory::get_count($sql . ' and INSTR(obj_type,"_auth")>0 ' . $f_sql, 0, 'c', 3600);
$withdraw = db_factory::get_count(sprintf(' select sum(fee) c from %switkey_withdraw
where withdraw_status=2 ', TABLEPRE) . $w_sql, 0, 'c', 3600);
$p_all = floatval($task + $service + $payitem + $auth + $withdraw);
break;
case 'withdraw':
$list = db_factory::query(sprintf(' select sum(withdraw_cash) cash,sum(fee) fee,
count(withdraw_id) count,pay_type from %switkey_withdraw where 1 = 1 ', TABLEPRE) . $w_sql . ' group by pay_type', 1, 3600);
$list && ($list = kekezu::get_arr_by_key($list, 'pay_type'));
$bank_arr = keke_glob_class::get_bank();
$pay_online = kekezu::get_payment_config('', 'online');
break;
case 'charge':
$sql = ' select sum(fina_cash) cash,sum(fina_credit) credit,count(fina_id) count ';
$r_sql = sprintf(' ,obj_type from %switkey_finance
where INSTR(obj_type,"_charge")>0 and fina_type = "in"', TABLEPRE);
$charge = db_factory::query($sql . $r_sql . $f_sql . ' group by obj_type ', 1, 3600);
$charge = kekezu::get_arr_by_key($charge, 'obj_type');
$fina_type = keke_glob_class::get_fina_charge_type();
break;
}
require keke_tpl_class::template(ADMIN_DIRECTORY . '/tpl/admin_finance_revenue');
示例7: get_work_info
public function get_work_info($w = array(), $p = array())
{
global $kekezu, $_K, $uid;
$work_arr = array();
$sql = " select a.*,b.seller_credit,b.seller_good_num,b.seller_total_num,b.seller_level from " . TABLEPRE . "witkey_task_work a left join " . TABLEPRE . "witkey_space b on a.uid=b.uid";
$count_sql = " select count(a.work_id) from " . TABLEPRE . "witkey_task_work a left join " . TABLEPRE . "witkey_space b on a.uid=b.uid";
$where = " where a.task_id = '{$this->_task_id}' ";
if (!empty($w)) {
$w['work_type'] == 'noview' and $where .= " and a.is_view !=1 ";
$w['work_type'] == 'my' and $where .= " and a.uid = '{$this->_uid}'";
isset($w['work_status']) and $where .= " and a.work_status = '" . intval($w['work_status']) . "'";
}
$where .= " order by field(a.work_status,'7','3','2','1') desc,work_time asc ";
if (!empty($p)) {
$page_obj = $kekezu->_page_obj;
$count = intval(db_factory::get_count($count_sql . $where));
$pages = $page_obj->getPages($count, $p['page_size'], $p['page'], $p['url'], $p['anchor']);
$where .= $pages['where'];
}
$work_info = db_factory::query($sql . $where);
$work_info = kekezu::get_arr_by_key($work_info, 'work_id');
$arrWorks['work_info'] = array();
if (is_array($work_info)) {
foreach ($work_info as $k => $v) {
$arrWorks['work_info'][$k] = $v;
$arrWorks['work_info'][$k]['attachment'] = array();
if ($v['work_file']) {
$fileids = explode(',', $v['work_file']);
$fileids = array_filter($fileids);
$fileids = implode(',', $fileids);
$arrWorks['work_info'][$k]['attachment'] = db_factory::query('select file_id,save_name,file_name from ' . TABLEPRE . 'witkey_file where file_id in (' . $fileids . ')');
}
$arrWorks['work_info'][$k]['comment'] = $this->get_comment('work', $this->_task_id, $v['work_id'], $v['uid']);
}
}
$arrWorks['pages'] = $pages;
$strWorkIds = implode(',', array_keys($work_info));
$arrWorks['mark'] = $this->has_mark($strWorkIds);
$arrWorks['count'] = $count;
$strWorkIds && $uid == $this->_task_info['uid'] and db_factory::execute('update ' . TABLEPRE . 'witkey_task_work set is_view=1 where work_id in (' . $strWorkIds . ') and is_view=0');
return $arrWorks;
}