<?php
// +----------------------------------------------------------------------
// | Copyright (c) 2015-2020.
// +----------------------------------------------------------------------
// | Describe: 活动操作模型类
// +----------------------------------------------------------------------
// | Author: woniu
// +----------------------------------------------------------------------
class model_activity
{
/**
* 获取单条活动信息
*
* @access static
* @name getSingleActivity
* @param mixed 参数一的说明
* @return array
*/
static function getSingleActivity($id,$select,$where=array()){
global $_W,$_GPC;
$where['id'] = $id;
$activityInfo = Util::getSingelData($select,'fx_activity',$where);
if(empty($activityInfo)) return array();
if($activityInfo['merchantid']){
$merchant = pdo_fetch("SELECT name FROM " . tablename('fx_merchant') . " WHERE uniacid = {$_W['uniacid']} and id={$activityInfo['merchantid']}");
$activityInfo['merchantname'] = $merchant['name'];
}
$activityInfo['storeids'] = unserialize($activityInfo['storeids']);
return $activityInfo;
}
/**
* 获取单表单信息
*
* @access static
* @name getSingleActivityForm
* @param mixed 参数一的说明
* @return array
*/
static function getSingleActivityForm($id){
global $_W;
$form = pdo_get('fx_form', array('id' => $id));
return $form;
}
/**
* 获取规格选项
*
* @access static
* @name getSingleActivityOption
* @param mixed 参数一的说明
* @return array
*/
static function getSingleActivityOption($id){
global $_W;
$option = pdo_get('fx_spec_option', array('id' => $id));
return $option;
}
/**
* 获取店铺
*
* @access static
* @name getNumActivityStore
* @param mixed 参数一的说明
* @return array
*/
static function getNumActivityStore($storeids){
global $_W;
if(empty($storeids))return FALSE;
foreach($storeids as$key=>$value){
if($value)$stores[$key] = pdo_fetch("select * from".tablename('fx_store')."where id ='{$value}' and uniacid={$_W['uniacid']}");
}
return $stores;
}
/**
* 获取表单
*
* @access static
* @name getNumActivityForm
* @param $id 商品ID
* @return array
*/
static function getNumActivityForm($id,$acType = 'web'){
//获取表单条目 Start
global $_W;
$condition = " uniacid = '{$_W['uniacid']}'";
$allforms = pdo_fetchall("select * from " . tablename('fx_form')." where".$condition." and activityid=:id order by displayorder asc",array(":id"=>$id));
$condition.= $acType == 'app' ? " and `show`=1" : "";
foreach ($allforms as &$s) {
$s['items'] = pdo_fetchall("select * from " . tablename('fx_form_item') . " where".$condition." and formid=".$s['id']." order by displayorder asc");
}
return array($allforms);
}
/**
* 获取规格
*
* @access static
* @name getNumActivitySpec
* @param $id 商品ID
* @return array
*/
static function getNumActivitySpec($id,$acType = 'web'){
//获取表单条目 Start
global $_W;
$condition = " uniacid = '{$_W['uniacid']}'";
$allspecs = pdo_fetchall("select * from " . tablename('fx_spec')." where".$condition." and activityid=:id order by displayorder asc",array(":id"=>$id));
$condition.= $acType == 'app' ? " and `show`=1" : "";
foreach ($allspecs as &$s) {
$s['items'] = pdo_fetchall("select * from " . tablename('fx_spec_item') . " where".$condition." and specid=".$s['id']." order by displayorder asc");
}
$options = pdo_fetchall("select * from " . tablename('fx_spec_option') . " where activityid=:id order by id asc", array(':id' => $id));
$specs = array();
if (count($options) > 0) {
$specitemids = explode("_", $options[0]['specs']);
foreach ($specitemids as $itemid) {
foreach ($allspecs as $ss) {
$items = $ss['items'];
foreach ($items as $it) {
if ($it['id'] == $itemid) {
$specs[] = $ss;
break;
}
}
}
}
//获取规格条目 End
//获取价格列表 Start
$html = '';
$html .= '<table class="table table-bordered table-condensed">';
$html .= '<thead>';
$html .= '<tr class="active">';
$len = count($specs);
$newlen = 1;
//多少种组合
$h = array();
//显示表格二维数组
$rowspans = array();
//每个列的rowspan
//计算每个列的行数 得到$rowspans和$newlen
for ($i = 0; $i < $len; $i++) {
//表头
$html .= "<th style='width:80px;'>" . $specs[$i]['title'] . "</th>";
//计算多种组合
$itemlen = count($specs[$i]['items']);
if ($itemlen <= 0) {
$itemlen = 1;
}
$newlen *= $itemlen;
//初始化 二维数组
$h = array();
for ($j = 0; $j < $newlen; $j++) {
$h[$i][$j] = array();
}
//计算rowspan
$l = count($specs[$i]['items']);
$rowspans[$i] = 1;
for ($j = $i + 1; $j < $len; $j++) {
$rowspans[$i] *= count($specs[$j]['items']);
}
}
//价格列表头部
$html .= '<th class="info" style="width:130px;"><div class=""><div style="padding-bottom:10px;text-align:center;font-size:16px;">活动名额</div><div class="input-group"><input type="text" class="form-control option_quota_all" VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-hand-o-down" title="批量设置" onclick="setCol(\'option_quota\');"></a></span></div></div></th>';
if ($_W['allow']['activity']['falseinfo'] || !$_W['allow']) {
$html .= '<th class="success" style="width:150px;"><div class=""><div style="padding-bottom:10px;text-align:center;font-size:16px;">虚拟名额</div><div class="input-group"><input type="text" class="form-control option_falsenum_all" VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-hand-o-down" title="批量设置" onclick="setCol(\'option_falsenum\');"></a></span></div></div></th>';
}
$html .= '<th class="warning" style="width:150px;"><div class=""><div style="padding-bottom:10px;text-align:center;font-size:16px;">报名费用</div><div class="input-group"><input type="text" class="form-control option_aprice_all" VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-hand-o-down" title="批量设置" onclick="setCol(\'option_aprice\');"></a></span></div></div></th>';
//$html .= '<th class="danger" style="width:150px;"><div class=""><div style="padding-bottom:10px;text-align:center;font-size:16px;">市场价格</div><div class="input-group"><input type="text" class="form-control option_costprice_all" VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-hand-o-down" title="批量设置" onclick="setCol(\'option_costprice\');"></a></span></div></div></th>';
$html .= '</tr></thead>';
//获得表格二维数组$h
for ($m = 0; $m < $len; $m++) {
$k = 0;
$kid = 0;
$n = 0;
for ($j = 0; $j < $newlen; $j++) {
$rowspan = $rowspans[$m];
if ($j % $rowspan == 0) {
$h[$m][$j] = array("html" => "<td rowspan='" . $rowspan . "'>" . $specs[$m]['items'][$kid]['title'] . "</td>", "id" => $specs[$m]['items'][$kid]['id']);
} else {
$h[$m][$j] = array("html" => "", "id" => $specs[$m]['items'][$kid]['id']);
}
$n++;
if ($n == $rowspan) {
$kid++;
if ($kid > count($specs[$m]['items']) - 1) {
$kid = 0;
}
$n = 0;
}
}
}
//获得整个价格列表
$hh = "";
for ($i = 0; $i < $newlen; $i++) {
$hh .= "<tr>";
$ids = array();
for ($j = 0; $j < $len; $j++) {
$hh .= $h[$j][$i]['html'];
$ids[] = $h[$j][$i]['id'];
}
$ids = implode("_", $ids);
$val = array("id" => "", "title" => "", "quota" => "", "costprice" => "", "aprice" => "", "falsenum" => "", "weight" => "");
foreach ($options as $o) {
if ($ids === $o['specs']
没有合适的资源?快使用搜索试试~ 我知道了~
活动报名 进阶支付版 版本3.3.3
共572个文件
php:152个
html:128个
png:112个
需积分: 9 17 下载量 109 浏览量
2018-01-17
11:01:05
上传
评论
收藏 4.95MB ZIP 举报
温馨提示
一、功能增加 1、增加个人资料修改页面。 2、增加报名记录支持规格名搜索 3、用户核销界面增加报名序号。 二、优化修复 1、修复主办方名称不统一BUG。 2、修复免审核功能开户不生效BUG。 3、优化主办登录界面版权logo显示。 4、优化参数设置。
资源推荐
资源详情
资源评论
收起资源包目录
活动报名 进阶支付版 版本3.3.3 (572个子文件)
common.css 336KB
mui.min.css 76KB
ueditor.css 45KB
ueditor.min.css 34KB
mui.ext.css 27KB
video-js.css 22KB
image.css 19KB
video.css 15KB
attachment.css 15KB
swiper.min.css 14KB
video-js.min.css 11KB
detail.css 9KB
shCoreDefault.css 7KB
wangEditor-mobile.css 6KB
wangEditor-mobile.min.css 4KB
scrawl.css 4KB
cropper.min.css 4KB
codemirror.css 3KB
charts.css 3KB
index.css 3KB
background.css 2KB
util.min.css 2KB
common.min.css 2KB
emotion.css 2KB
dialogbase.css 2KB
music.css 2KB
edittable.css 1KB
dropload.css 1KB
template.css 1KB
style.css 456B
help.css 395B
style.min.css 221B
iframe.css 42B
Thumbs.db 115KB
mui.ext.eot 19KB
icomoon-ext.eot 5KB
icomoon.eot 4KB
vjs.eot 3KB
UEditorSnapscreen.exe 508KB
wface.gif 49KB
jxface2.gif 40KB
yface.gif 28KB
bface.gif 27KB
icons.gif 20KB
file-icons.gif 20KB
file-icons.gif 20KB
tface.gif 19KB
fface.gif 18KB
cface.gif 8KB
gw-wx.gif 6KB
icons-all.gif 4KB
loader.gif 2KB
videologo.gif 2KB
cancelbutton.gif 1KB
button-bg.gif 1KB
lock.gif 1KB
alignicon.gif 1KB
word.gif 1019B
icon_doc.gif 1012B
icon_psd.gif 1009B
icon_rar.gif 1007B
icon_xls.gif 1005B
icon_ppt.gif 1001B
icon_mv.gif 1001B
icon_pdf.gif 996B
icon_mp3.gif 986B
icon_txt.gif 970B
icon_jpg.gif 950B
icon_exe.gif 949B
icon_chm.gif 923B
loading.gif 771B
loading.gif 734B
icons.gif 453B
icons.gif 453B
icons.gif 453B
success.gif 445B
success.gif 445B
success.gif 445B
cursor_v.gif 370B
cursor_h.gif 253B
anchor.gif 184B
highlighted.gif 111B
unhighlighted.gif 111B
bg.gif 84B
pagebreak.gif 54B
spacer.gif 43B
0.gif 43B
activity.html 70KB
map_baidu.html 49KB
map_tencent.html 49KB
map_tencent.html 48KB
setting.html 48KB
join.html 34KB
detail.html 31KB
activity_list.html 31KB
records.html 27KB
hexiao.html 26KB
project.html 24KB
merchant.html 24KB
account.html 19KB
共 572 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
gougouhuiliang
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 筷手引流工具.apk
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功