public function fieldsFormDisplay($rid = 0) { load()->model('mc'); global $_W, $_GPC; //要嵌入规则编辑页的自定义内容,这里 $rid 为对应的规则编号,新增时为 0 $creditnames = uni_setting($_W['uniacid'], array('creditnames')); if ($creditnames) { foreach ($creditnames['creditnames'] as $index => $creditname) { if ($creditname['enabled'] == 0) { unset($creditnames['creditnames'][$index]); } } $scredit = implode(', ', array_keys($creditnames['creditnames'])); } else { $scredit = ''; } $groups = mc_groups($_W['uniacid']); $couponlists = pdo_fetchall('SELECT couponid,title,type,credittype,credit,endtime,amount,dosage FROM ' . tablename('activity_coupon') . ' WHERE uniacid = :uniacid AND type = :type AND endtime > :endtime ORDER BY endtime ASC ', array(':uniacid' => $_W['uniacid'], ':type' => 1, ':endtime' => TIMESTAMP)); $tokenlists = pdo_fetchall('SELECT couponid,title,type,credittype,credit,endtime,amount,dosage FROM ' . tablename('activity_coupon') . ' WHERE uniacid = :uniacid AND type = :type AND endtime > :endtime ORDER BY endtime ASC ', array(':uniacid' => $_W['uniacid'], ':type' => 2, ':endtime' => TIMESTAMP)); $goodslists = pdo_fetchall('SELECT id,title,type,credittype,endtime,total,num,credit FROM ' . tablename('activity_exchange') . ' WHERE uniacid = :uniacid AND type = :type AND endtime > :endtime ORDER BY endtime ASC', array(':uniacid' => $_W['uniacid'], ':type' => 3, ':endtime' => TIMESTAMP)); //print_r($couponlists); load()->func('tpl'); if ($rid == 0) { $reply = array('title' => '幸运大抽奖活动开始了!', 'description' => '幸运大抽奖活动开始啦!', 'tips' => '每次抽奖需要花费50积分,一等奖为39元的现金抵扣券,二等奖为100积分,三等奖为50积分,四等奖为30积分。每人每天限抽2次。', 'remark' => '中奖积分请到会员主页查看', 'starttime' => time(), 'endtime' => time() + 10 * 84400, 'reg' => '0', 'status' => '1', 'awardnum' => '1', 'playnum' => '5', 'dayplaynum' => '1', 'zfcs' => '1', 'zjcs' => '1', 'rate' => '10', 'need_type' => 'credit1', 'need_num' => '0', 'give_type' => 'credit1', 'give_num' => '0', 'onlynone' => '1', 'share_title' => '欢迎参加幸运大抽奖活动', 'share_content' => '亲,欢迎参加幸运大抽奖活动,祝您好运哦!! 亲,需要绑定账号才可以参加哦'); $prizes = array('p1_type' => 'credit1'); } else { $reply = pdo_fetch("SELECT * FROM " . tablename($this->table_reply) . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid)); $prizes = iunserializer($reply['prizes']); } include $this->template('form'); }
<?php /** * [WeEngine System] Copyright (c) 2014 WE7.CC * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details. */ defined('IN_IA') or exit('Access Denied'); $dos = array('display', 'detail'); $do = in_array($do, $dos) ? $do : 'display'; if ($do == 'display') { $profile = mc_fetch($_W['member']['uid'], array('nickname', 'avatar', 'mobile', 'groupid')); $mcgroups = mc_groups(); $profile['group'] = $mcgroups[$profile['groupid']]; $stores = pdo_fetchall('SELECT * FROM ' . tablename('activity_stores') . ' WHERE uniacid = :uniacid', array(':uniacid' => $_W['uniacid'])); } if ($do == 'detail') { $id = intval($_GPC['id']); $store = pdo_get('activity_stores', array('uniacid' => $_W['uniacid'], 'id' => $id)); if (empty($store)) { message('门店不存在或已删除', referer(), 'error'); } $store['photo_list'] = iunserializer($store['photo_list']); $store['category'] = iunserializer($store['category']); } template('mc/store');
function account_fetch($acid) { $account = pdo_fetch("SELECT w.*, a.type, a.isconnect FROM " . tablename('account') . " a INNER JOIN " . tablename('account_wechats') . " w USING(acid) WHERE acid = :acid", array(':acid' => $acid)); $uniacid = $account['uniacid']; $owneruid = pdo_fetchcolumn("SELECT uid FROM " . tablename('uni_account_users') . " WHERE uniacid = :uniacid AND role = 'owner'", array(':uniacid' => $uniacid)); load()->model('user'); $owner = user_single(array('uid' => $owneruid)); $account['uid'] = $owner['uid']; $account['starttime'] = $owner['starttime']; $account['endtime'] = $owner['endtime']; load()->model('mc'); $account['groups'] = mc_groups($uniacid); $account['grouplevel'] = pdo_fetchcolumn('SELECT grouplevel FROM ' . tablename('uni_settings') . ' WHERE uniacid = :uniacid', array(':uniacid' => $uniacid)); return $account; }
$_GPC['createtime'] = TIMESTAMP; pdo_insert('mc_members', $_GPC); $uid = pdo_insertid(); pdo_update('mc_mapping_fans', array('uid' => $uid), array('fanid' => $fanid, 'uniacid' => $_W['uniacid'])); message('更新资料成功!', url('mc/member/post', array('uid' => $uid)), 'success'); } else { $email_effective = intval($_GPC['email_effective']); if ($email_effective == 1 && empty($_GPC['email'])) { unset($_GPC['email']); } $uid = mc_update($uid, $_GPC); } } message('更新资料成功!', referer(), 'success'); } $groups = mc_groups($_W['uniacid']); $profile = pdo_get('mc_members', array('uniacid' => $_W['uniacid'], 'uid' => $uid)); if (!empty($profile)) { if (empty($profile['email']) || !empty($profile['email']) && substr($profile['email'], -6) == '012wz.com' && strlen($profile['email']) == 39) { $profile['email_effective'] = 1; $profile['email'] = ''; } else { $profile['email_effective'] = 2; } } if (empty($uid)) { $fanid = intval($_GPC['fanid']); $tag = pdo_fetchcolumn('SELECT tag FROM ' . tablename('mc_mapping_fans') . ' WHERE uniacid = :uniacid AND fanid = :fanid', array(':uniacid' => $_W['uniacid'], ':fanid' => $fanid)); if (is_base64($tag)) { $tag = base64_decode($tag); }
} if ($operation == 'display') { $children = array(); $category = pdo_fetchall("SELECT * FROM " . tablename('jufeng_wcy_category') . " WHERE weid = '{$_W['uniacid']}' ORDER BY parentid ASC, displayorder DESC"); foreach ($category as $index => $row) { if (!empty($row['parentid'])) { $children[$row['parentid']][] = $row; unset($category[$index]); } } include $this->template('category'); } elseif ($operation == 'post') { $parentid = intval($_GPC['parentid']); $id = intval($_GPC['id']); load()->model('mc'); $groups = mc_groups(); $shoptype = pdo_fetchall("SELECT * FROM " . tablename('jufeng_wcy_shoptype') . " WHERE weid = '{$_W['uniacid']}'"); if (!empty($id)) { $category = pdo_fetch("SELECT * FROM " . tablename('jufeng_wcy_category') . " WHERE id = '{$id}'"); } else { $category = array('displayorder' => 0); } $ptime1 = $category['time1']; $ptime2 = $category['time2']; $ptime3 = $category['time3']; $ptime4 = $category['time4']; if (!empty($parentid)) { $parent = pdo_fetch("SELECT id, name FROM " . tablename('jufeng_wcy_category') . " WHERE id = '{$parentid}'"); if (empty($parent)) { message('抱歉,店铺不存在或是已经被删除!', $this->createWebUrl('post'), 'error'); }