本文整理汇总了PHP中array_under_reset函数的典型用法代码示例。如果您正苦于以下问题:PHP array_under_reset函数的具体用法?PHP array_under_reset怎么用?PHP array_under_reset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了array_under_reset函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: waybill_manageOp
/**
* 模板管理
*/
public function waybill_manageOp()
{
$model_store_extend = Model('store_extend');
$model_express = Model('express');
$model_store_waybill = Model('store_waybill');
$store_extend_info = $model_store_extend->getStoreExtendInfo(array('store_id' => $_SESSION['store_id']), 'express');
$store_express = $store_extend_info['express'];
$express_list = $model_express->getExpressListByID($store_express);
$store_waybill_list = $model_store_waybill->getStoreWaybillListWithWaybillInfo($_SESSION['store_id'], $store_express);
$store_waybill_list = array_under_reset($store_waybill_list, 'express_id');
if (!empty($express_list)) {
foreach ($express_list as $key => $value) {
if (!empty($store_waybill_list[$value['id']])) {
$express_list[$key]['waybill_name'] = $store_waybill_list[$value['id']]['waybill_name'];
$express_list[$key]['store_waybill_id'] = $store_waybill_list[$value['id']]['store_waybill_id'];
$express_list[$key]['is_default_text'] = $store_waybill_list[$value['id']]['is_default'] ? '是' : '否';
$express_list[$key]['waybill_image_url'] = getWaybillImageUrl($store_waybill_list[$value['id']]['waybill_image']);
$express_list[$key]['waybill_width'] = $store_waybill_list[$value['id']]['waybill_width'];
$express_list[$key]['waybill_height'] = $store_waybill_list[$value['id']]['waybill_height'];
$express_list[$key]['bind'] = true;
} else {
$express_list[$key]['waybill_name'] = '未绑定';
$express_list[$key]['bind'] = false;
}
}
}
Tpl::output('express_list', $express_list);
$this->profile_menu('waybill_manage');
Tpl::showpage('store_waybill.manage');
}
示例2: _get_root_class
/**
* 返回一级分类列表
*/
private function _get_root_class() {
$model_goods_class = Model('goods_class');
$model_mb_category = Model('mb_category');
$goods_class_array = ($nav = F('goods_class'))? $nav :H('goods_class',true,'file');
$class_list = $model_goods_class->getClassList(array('gc_parent_id' => 0), 'gc_id,gc_name');
//$mb_categroy = $model_mb_category->getLinkList(array());
$mb_categroy = array_under_reset($mb_categroy, 'gc_id');
foreach ($class_list as $key => $value) {
if(!empty($mb_categroy[$value['gc_id']])) {
$class_list[$key]['image'] = UPLOAD_SITE_URL.DS.ATTACH_MOBILE.DS.'category'.DS.$mb_categroy[$value['gc_id']]['gc_thumb'];
} else {
$class_list[$key]['image'] = '';
}
$class_list[$key]['text'] = '';
$child_class_string = $goods_class_array[$value['gc_id']]['child'];
$child_class_array = explode(',', $child_class_string);
foreach ($child_class_array as $child_class) {
$class_list[$key]['text'] .= $goods_class_array[$child_class]['gc_name'] . '/';
}
$class_list[$key]['text'] = rtrim($class_list[$key]['text'], '/');
}
output_data(array('class_list' => $class_list));
}
示例3: get_theme_listOp
public function get_theme_listOp()
{
$result = '';
$data_count = intval($_GET['data_count']);
if ($data_count <= 0) {
$data_count = 2;
}
$model = Model();
$theme_list = $model->table('circle_theme')->field('*, is_recommend*rand()*10000 + has_affix*rand() as rand')->where(array('circle_status' => 1, 'is_closed' => 0))->where(array('has_affix' => 1))->order('rand desc')->limit($data_count)->select();
if (!empty($theme_list)) {
$theme_list = array_under_reset($theme_list, 'theme_id');
$themeid_array = array_keys($theme_list);
// 附件
$affix_list = $model->table('circle_affix')->where(array('theme_id' => array('in', $themeid_array), 'affix_type' => 1))->group('theme_id')->select();
if (!empty($affix_list)) {
$affix_list = array_under_reset($affix_list, 'theme_id');
}
foreach ($theme_list as $key => $val) {
if (isset($affix_list[$val['theme_id']])) {
$theme_list[$key]['affix'] = themeImageUrl($affix_list[$val['theme_id']]['affix_filethumb']);
}
}
}
if ($this->data_type === 'json') {
$result = json_encode($theme_list);
} else {
Tpl::output('theme_list', $theme_list);
ob_start();
Tpl::showpage('api_theme_list', 'null_layout');
$result = ob_get_clean();
}
$this->return_result($result);
}
示例4: class_listOp
/**
* 相册列表
*/
public function class_listOp()
{
$model = Model();
// 相册总数量
$where = array();
if ($_GET['class_name'] != '') {
$where['ac_name'] = array('like', '%' . trim($_GET['class_name']) . '%');
}
if ($_GET['user_name'] != '') {
$where['member_name'] = array('like', '%' . trim($_GET['user_name']) . '%');
}
$ac_list = $model->table('sns_albumclass,member')->field('sns_albumclass.*,member.member_name')->on('sns_albumclass.member_id = member.member_id')->join('left')->where($where)->page('10')->select();
if (!empty($ac_list)) {
$acid_array = array();
foreach ($ac_list as $val) {
$acid_array[] = $val['ac_id'];
}
// 相册中商品数量
$ap_count = $model->cls()->table('sns_albumpic')->field('count(ap_id) as count,ac_id')->where(array('ac_id' => array('in', $acid_array)))->group('ac_id')->select();
$ap_count = array_under_reset($ap_count, 'ac_id', 1);
foreach ($ac_list as $key => $val) {
if (isset($ap_count[$val['ac_id']])) {
$ac_list[$key]['count'] = $ap_count[$val['ac_id']]['count'];
} else {
$ac_list[$key]['count'] = 0;
}
}
}
Tpl::output('showpage', $model->showpage(2));
Tpl::output('ac_list', $ac_list);
Tpl::showpage('sns_malbum.classlist');
}
示例5: bundling_listOp
/**
* 活动管理
*/
public function bundling_listOp()
{
$model_bundling = Model('p_bundling');
// 查询添加
$where = '';
if ($_GET['bundling_name'] != '') {
$where['bl_name'] = array('like', '%' . trim($_GET['bundling_name']) . '%');
}
if ($_GET['store_name'] != '') {
$where['store_name'] = array('like', '%' . trim($_GET['store_name']) . '%');
}
if (is_numeric($_GET['state'])) {
$where['bl_state'] = $_GET['state'];
}
$bundling_list = $model_bundling->getBundlingList($where);
$bundling_list = array_under_reset($bundling_list, 'bl_id');
Tpl::output('show_page', $model_bundling->showpage(2));
if (!empty($bundling_list)) {
$blid_array = array_keys($bundling_list);
$bgoods_array = $model_bundling->getBundlingGoodsList(array('bl_id' => array('in', $blid_array)), 'bl_id,goods_id,count(*) as count', 'bl_appoint desc', 'bl_id');
$bgoods_array = array_under_reset($bgoods_array, 'bl_id');
foreach ($bundling_list as $key => $val) {
$bundling_list[$key]['goods_id'] = $bgoods_array[$val['bl_id']]['goods_id'];
$bundling_list[$key]['count'] = $bgoods_array[$val['bl_id']]['count'];
}
}
Tpl::output('list', $bundling_list);
// 状态数组
$state_array = array(0 => Language::get('bundling_state_0'), 1 => Language::get('bundling_state_1'));
Tpl::output('state_array', $state_array);
// 输出自营店铺IDS
Tpl::output('flippedOwnShopIds', array_flip(model('store')->getOwnShopIds()));
Tpl::showpage('promotion_bundling.list');
}
示例6: manageList
/**
* 圈主和管理信息
*/
protected function manageList()
{
$manager_list = Model()->table('circle_member')->where(array('circle_id' => $this->c_id, 'is_identity' => array('in', array(1, 2))))->select();
$manager_list = array_under_reset($manager_list, 'is_identity', 2);
Tpl::output('creator', $manager_list[1][0]);
$manager_list = array_under_reset($manager_list[2], 'member_id', 1);
Tpl::output('manager_list', $manager_list);
}
示例7: circleOp
/**
* 圈子
*/
public function circleOp(){
$model = Model();
$cm_list = $model->table('circle_member')->where(array('member_id'=>$this->master_id))->order('cm_jointime desc')->select();
if(!empty($cm_list)){
$cm_list = array_under_reset($cm_list, 'circle_id'); $circleid_array = array_keys($cm_list);
$circle_list = $model->table('circle')->where(array('circle_id'=>array('in', $circleid_array)))->select();
Tpl::output('circle_list', $circle_list);
}
$this->profile_menu('circle');
Tpl::showpage('sns_circle');
}
示例8: account_listOp
public function account_listOp()
{
$model_seller = Model('seller');
$condition = array('store_id' => $_SESSION['store_id'], 'seller_group_id' => array('gt', 0));
$seller_list = $model_seller->getSellerList($condition);
Tpl::output('seller_list', $seller_list);
$model_seller_group = Model('seller_group');
$seller_group_list = $model_seller_group->getSellerGroupList(array('store_id' => $_SESSION['store_id']));
$seller_group_array = array_under_reset($seller_group_list, 'group_id');
Tpl::output('seller_group_array', $seller_group_array);
$this->profile_menu('account_list');
Tpl::showpage('store_account.list');
}
示例9: my_groupOp
/**
* Personal Center my circle group
*/
public function my_groupOp()
{
$model = Model();
$circlemember_array = $model->table('circle_member')->where(array('member_id' => $this->m_id))->select();
if (!empty($circlemember_array)) {
$circlemember_array = array_under_reset($circlemember_array, 'circle_id');
Tpl::output('cm_array', $circlemember_array);
$circleid_array = array_keys($circlemember_array);
$circle_list = $model->table('circle')->where(array('circle_id' => array('in', $circleid_array)))->select();
Tpl::output('circle_list', $circle_list);
}
$this->profile_menu('group', 'group');
Tpl::showpage('p_center.group');
}
示例10: indexOp
function indexOp()
{
$model = Model('trade');
if (!in_array($_GET['state'], array('deliverno', 'delivering', 'delivered'))) {
$_GET['state'] = 'deliverno';
}
$state = str_replace(array('deliverno', 'delivering', 'delivered'), array('20,60', 30, 40), $_GET['state']);
$condition = array();
$condition['order.seller_id'] = $_SESSION['member_id'];
$condition['order.order_state'] = array('in', $state);
$order_list = $model->order_list($condition, 5);
if (is_array($order_list)) {
$arr_buyer_id = array();
$arr_order_id = array();
foreach ($order_list as $v) {
$arr_buyer_id[] = $v['buyer_id'];
$arr_order_id[] = $v['order_id'];
}
$goods_list = $model->table('order_goods')->where(array('order_id' => array('in', $arr_order_id)))->select();
foreach ($order_list as $key => $value) {
foreach ($goods_list as $k => $v) {
if ($v['order_id'] == $value['order_id']) {
$order_list[$key]['goods'][] = $v;
unset($goods_list[$k]);
}
}
}
$arr_buyer_id = array_unique($arr_buyer_id);
$member_list = $model->table('member')->where(array('member_id' => array('in', $arr_buyer_id)))->select();
$member_list = array_under_reset($member_list, 'member_id');
Tpl::output('member_array', $member_list);
Tpl::output('order_array', $order_list);
Tpl::output('show_page', $model->showpage());
}
self::profile_menu('deliver', $_GET['state']);
Tpl::output('menu_sign', 'deliver');
Tpl::output('menu_sign_url', 'index.php?act=deliver&op=index');
Tpl::output('menu_sign1', $_GET['state']);
Tpl::showpage('store_order_deliver');
}
示例11: indexOp
/**
* Members of the level set
*/
public function indexOp()
{
$model = Model();
if (chksubmit()) {
$insert_all = array();
foreach ($_POST['cmld'] as $key => $val) {
$insert_all[$key]['mld_id'] = $val['id'];
$insert_all[$key]['mld_name'] = $val['name'];
$insert_all[$key]['mld_exp'] = $val['exp'];
}
$insert_all = array_values($insert_all);
$rs = $model->table('circle_mldefault')->insertAll($insert_all, array(), true);
if ($rs) {
showMessage(L('nc_common_op_succ'));
} else {
showMessage(L('nc_common_op_fail'));
}
}
$mld_list = $model->table('circle_mldefault')->select();
$mld_list = array_under_reset($mld_list, 'mld_id');
Tpl::output('mld_list', $mld_list);
Tpl::showpage('circle_memberlevel');
}
示例12: getGoodsClass
/**
* 取得店铺绑定的分类
*
* @param number $store_id 店铺id
* @param number $pid 父级分类id
* @param number $deep 深度
* @return array 二维数组
*/
public function getGoodsClass($store_id, $pid = 0, $deep = 1)
{
// 读取商品分类
$gc_list = $this->getGoodsClassList(array('gc_parent_id' => $pid), 'gc_id, gc_name, type_id');
// 如果店铺ID不为商城店铺的话,读取绑定分类
if (!checkPlatformStore()) {
$gc_list = array_under_reset($gc_list, 'gc_id');
$model_storebindclass = Model('store_bind_class');
$gcid_array = $model_storebindclass->getStoreBindClassList(array('store_id' => $store_id), '', "class_{$deep} asc", "distinct class_{$deep}");
if (!empty($gcid_array)) {
$tmp_gc_list = array();
foreach ($gcid_array as $value) {
if (isset($gc_list[$value["class_{$deep}"]])) {
$tmp_gc_list[] = $gc_list[$value["class_{$deep}"]];
}
}
$gc_list = $tmp_gc_list;
} else {
return array();
}
}
return $gc_list;
}
示例13: like_listOp
public function like_listOp()
{
$type = 'goods';
if (isset($_GET['type'])) {
$type = $_GET['type'];
}
$model_like = Model('micro_like');
$condition = array();
$condition['like_member_id'] = $this->member_info['member_id'];
$type_array = self::get_channel_type($type);
$condition['like_type'] = $type_array['type_id'];
switch ($type) {
case 'personal':
Tpl::output('list', $model_like->getPersonalList($condition, 35));
break;
case 'album':
Tpl::output('list', array());
break;
case 'store':
$like_store_list = $model_like->getStoreList($condition, 30);
$store_list = array();
if (!empty($like_store_list)) {
$store_id = '';
foreach ($like_store_list as $value) {
$store_id .= $value['like_object_id'] . ',';
}
$store_id = rtrim($store_id, ',');
$model_microshop_store = Model('micro_store');
$store_list = $model_microshop_store->getListWithStoreInfo(array('shop_store_id' => array('in', $store_id)), null, 'microshop_sort asc');
}
$like_store_list = array_under_reset($like_store_list, 'like_object_id');
Tpl::output('like_store_list', $like_store_list);
Tpl::output('list', $store_list);
break;
default:
Tpl::output('list', $model_like->getGoodsList($condition, 35));
break;
}
Tpl::output('show_page', $model_like->showpage(2));
Tpl::output('home_sign', 'like');
Tpl::output('like_sign', $type);
Tpl::showpage('home');
}
示例14: user_circlesOp
/**
* GET 用户的圈子
*/
public function user_circlesOp()
{
$model = Model();
$cm_list = $model->table('circle_member')->where(array('member_id' => $this->member_id, 'cm_state' => array('not in', array(0, 2))))->order('cm_jointime desc')->select();
if (!empty($cm_list)) {
$cm_list = array_under_reset($cm_list, 'circle_id');
$circleid_array = array_keys($cm_list);
$circle_list = $model->table('circle')->where(array('circle_id' => array('in', $circleid_array)))->select();
}
output_data(array('circle_list' => $circle_list));
}
示例15: album_pic_listOp
/**
* 图片列表
*/
public function album_pic_listOp()
{
$id = intval($_GET['id']);
if ($id <= 0) {
showMessage(Language::get('album_parameter_error'), '', 'html', 'error');
}
/**
* 实例化类
*/
$model = Model();
$where = array();
$where['ac_id'] = $id;
$param['member_id'] = $this->master_id;
$order = 'ap_id desc';
if ($_GET['sort'] != '') {
switch ($_GET['sort']) {
case '0':
$order = 'upload_time desc';
break;
case '1':
$order = 'upload_time asc';
break;
case '2':
$order = 'ap_size desc';
break;
case '3':
$order = 'ap_size asc';
break;
case '4':
$order = 'ap_name desc';
break;
case '5':
$order = 'ap_name asc';
break;
}
}
$pic_list = $model->table('sns_albumpic')->where($where)->order($order)->page(36)->select();
Tpl::output('pic_list', $pic_list);
Tpl::output('show_page', $model->showpage());
/**
* 相册列表
*/
$where = array();
$where['member_id'] = $this->master_id;
$class_array = $model->table('sns_albumclass')->where($where)->select();
if (empty($class_array)) {
showMessage(Language::get('wrong_argument'), '', '', 'error');
}
// 整理
$class_array = array_under_reset($class_array, 'ac_id');
$class_list = $class_info = array();
foreach ($class_array as $val) {
if ($val['ac_id'] == $id) {
$class_info = $val;
} else {
$class_list[] = $val;
}
}
Tpl::output('class_list', $class_list);
Tpl::output('class_info', $class_info);
self::profile_menu('album_pic', 'pic_list');
Tpl::showpage('sns_album_pic_list');
}