<?php
/**
* 易福网
*
* http://www.efwww.com
*/
defined('IN_IA') or exit('Access Denied');
define('YPUK_TCHK', 'ypuk_tchk');
define('YPUK_TCHK_RES', '../addons/' . YPUK_TCHK . "/");
require_once IA_ROOT . '/addons/' . YPUK_TCHK . '/dbconfig.class.php';
class Ypuk_TchkModuleWxapp extends WeModuleWxapp
{
public static $PANICBUY_STATUS_WKS = 0;
public static $PANICBUY_STATUS_ZC = 1;
public static $PANICBUY_STATUS_JS = 2;
public static $PANICBUY_STATUS_XD = 3;
public static $PANICBUY_STATUS_GM = 4;
public static $PANICBUY_STATUS_YFH = 5;
public static $PANICBUY_STATUS_YWC = 6;
public static $PANICBUY_STATUS_YGQ = 7;
public static $DEFAULT_AVATAR = '../../resource/images/default_avatar.png';
public static $DEFAULT_CARD = '../../resource/images/default_card.jpg';
public static $DEFAULT_BUINESS_LOGO = '../../resource/images/default_buiness_logo.jpg';
public static $DEFAULT_APPLY_ICON = '../../resource/images/apply_icon.png';
public static $DEFAULT_BUINESSTOP_BANNER = '../../resource/images/default_buinesstop_banner.jpg';
public static $DEFAULT_AllCAT_ICON = '../../resource/images/default_allcat_icon.png';
public static $STATUS_WKS = 0;
public static $STATUS_ZC = 1;
public static $STATUS_JS = 2;
public $Setting;
public $attachment_root;
public function __construct()
{
global $_W;
}
public function doPageBuinessList()
{
global $_GPC, $_W;
$message = '成功';
load()->model('mc');
$pindex = max(1, intval($_GPC['page']));
$psize = 20;
$mod = $_GPC['type'];
$sort = $_GPC['sort'];
$ulat = $_GPC['ulat'];
$ulng = $_GPC['ulng'];
$searchkey = $_GPC['searchkey'];
$where = ' ';
if ($mod == 'now') {
$where .= ' AND ((starttime<' . TIMESTAMP . ' AND endtime>' . TIMESTAMP . ') OR discounttime=0)';
}
if ($mod == 'ready') {
$where .= ' AND starttime>' . TIMESTAMP . ' AND endtime>' . TIMESTAMP . '';
}
if ($sort == 'default' || $sort == '') {
$orderby = ' ORDER BY sort ASC ';
}
if ($sort == 'score') {
$orderby = ' ORDER BY score DESC ';
}
if (!empty($searchkey) && $searchkey != '') {
$where .= "AND ((business_name like '%{$searchkey}%') or (intro like '%{$searchkey}%') or (business_address like '%{$searchkey}%'))";
}
if ($_GPC['catid'] && $_GPC['catid'] != 0) {
$where .= ' AND catid=' . $_GPC['catid'];
}
if ($_GPC['regionid'] && $_GPC['regionid'] != 0) {
$where .= ' AND regionid=' . $_GPC['regionid'];
}
if ($_GPC['recommend'] == 1) {
$where .= ' AND recommend=1';
}
if ($sort == 'distance') {
$list = pdo_fetchall("SELECT *,(POWER(MOD(ABS(business_longitude - '{$ulng}'),360),2) + POWER(ABS(business_latitude - '{$ulat}'),2)) AS distance FROM " . tablename(DBCONFIG::$TABLE_TCHK_BUINESS) . " WHERE weid='{$_W['weid']}'" . $where . " ORDER BY distance asc LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
} else {
$list = pdo_fetchall("SELECT * FROM " . tablename(DBCONFIG::$TABLE_TCHK_BUINESS) . " WHERE weid='{$_W['weid']}'" . $where . " " . $orderby . " LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
}
foreach ($list as $key => $val) {
$list[$key]['discount_list'] = pdo_fetchall("SELECT * FROM " . tablename(DBCONFIG::$TABLE_TCHK_DISCOUNT) . " WHERE weid='{$_W['weid']}' AND businessid='{$val['id']}' ORDER BY id DESC");
if (!empty($ulat) && !empty($ulng) && !empty($val['business_latitude']) && !empty($val['business_longitude'])) {
$distance = $this->getdistance($ulat, $ulng, $val['business_latitude'], $val['business_longitude'], 'K');
$list[$key]['distance'] = round($distance, 2);
} else {
$list[$key]['distance'] = 'nodata';
}
if ($val['discounttime'] == 1) {
if (TIMESTAMP < $val['starttime']) {
$list[$key]['status'] = $this::$STATUS_WKS;
} elseif (TIMESTAMP > $val['endtime']) {
$list[$key]['status'] = $this::$STATUS_JS;
} else {
$list[$key]['status'] = $this::$STATUS_ZC;
}
$list[$key]['starttime'] = date('m月d日', $val['starttime']);
$list[$key]['endtime'] = date('m月d日', $val['endtime']);
}
$list[$key]['price'] = floatval($val['price']);
if (!empty($val['score'])) {
$list[$key]['score'] = $val['score'];
} else {
$list[$key]['score'] = '5.0';
}
if (empty($val['logo'])) {
$list[$key]['logo'] = $this::$DEFAULT_BUINESS_LOGO;
} else {
$list[$key]['logo'] = tomedia($val['logo']);
}
$list[$key]['hideDiscount'] = true;
}
if ($_GPC['page'] == 1) {
$usercard = $this->findUserCard($_GPC['uid']);
if (!empty($usercard)) {
$result['card'] = $usercard;
} else {
$result['card'] = 'nocard';
}
$setting = pdo_fetch("SELECT cardname FROM " . tablename(DBCONFIG::$TABLE_TCHK_SETTING) . " WHERE weid='{$_W['weid']}'");
if (!empty($setting['cardname'])) {
$result['cardname'] = $setting['cardname'];
} else {
$result['cardname'] = '黑卡';
}
}
$result['list'] = $list;
if (empty($_GPC['version']) || $_GPC['version'] < '2.4') {
$result = $list;
}
return $this->result(0, $message, $result);
}
public function doPageBuinessTopList()
{
global $_GPC, $_W;
$message = '成功';
$id = $_GPC['id'];
$pindex = max(1, intval($_GPC['page']));
$psize = 20;
$ulat = $_GPC['ulat'];
$ulng = $_GPC['ulng'];
$businessTopInfo = pdo_fetch("SELECT * FROM " . tablename(DBCONFIG::$TABLE_TCHK_BUSINESSTOP) . " WHERE weid='{$_W['weid']}' AND id='{$id}'");
if (empty($businessTopInfo['banner'])) {
$businessTopInfo['banner'] = $this::$DEFAULT_BUINESSTOP_BANNER;
} else {
$businessTopInfo['banner'] = tomedia($businessTopInfo['banner']);
}
$list = pdo_fetchall("SELECT businessid,sort,intro FROM " . tablename(DBCONFIG::$TABLE_TCHK_BUSINESSTOP_BIND) . " WHERE weid='{$_W['weid']}' AND topid='{$id}' LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
if (!empty($list)) {
foreach ($list as $key => $val) {
$buiness = pdo_fetch("SELECT * FROM" . tablename(DBCONFIG::$TABLE_TCHK_BUINESS) . "WHERE weid='{$_W['weid']}' AND id='{$val['businessid']}'");
$buiness['discount_list'] = pdo_fetchall("SELECT * FROM " . tablename(DBCONFIG::$TABLE_TCHK_DISCOUNT) . " WHERE weid='{$_W['weid']}' AND businessid='{$val['businessid']}' ORDER BY id DESC");
if (!empty($ulat) && !empty($ulng) && !empty($buiness['business_latitude']) && !empty($buiness['business_longitude'])) {
$distance = $this->getdistance($ulat, $ulng, $buiness['business_latitude'], $buiness['business_longitude'], 'K');
$buiness['distance'] = round($distance, 2);
} else {
$buiness['distance'] = 'nodata';
}
if ($buiness['discounttime'] == 1) {
if (TIMESTAMP < $buiness['starttime']) {
$buiness['status'] = $this::$STATUS_WKS;
} elseif (TIMESTAMP > $buiness
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
微信小程序开发-同城黑卡案例源码.zip (292个子文件)
setting.html 41KB
panicbuy_manage.html 24KB
buiness_manage.html 23KB
business_top.html 13KB
card.html 8KB
order_detail.html 7KB
cardcode.html 6KB
order_list.html 6KB
clerk.html 5KB
discount_log.html 4KB
record.html 4KB
withdraw_list.html 3KB
category.html 3KB
remind.html 2KB
clerk_log.html 2KB
notice.html 2KB
region.html 2KB
comment_list.html 2KB
withdraw_detail.html 2KB
同城黑卡小程序截屏.jpeg 248KB
default_buinesstop_banner.jpg 111KB
panicbuy_poster_bg.jpg 38KB
business_poster_bg.jpg 37KB
default_card.jpg 34KB
apply_model_top.jpg 33KB
icon.jpg 31KB
default_swiper.jpg 26KB
zhang.jpg 20KB
icon-custom.jpg 10KB
preview-custom.jpg 10KB
jquery-1.11.2.min.js 95KB
showdown.js 37KB
underscore.js 25KB
util.js 16KB
detail.js 8KB
buiness.js 8KB
htmlToWxml.js 8KB
paycard.js 6KB
panicbuy_detail.js 6KB
index.js 6KB
html2json.js 5KB
wxDiscode.js 5KB
panicbuy_addorder.js 5KB
md5.js 5KB
selectarea.js 4KB
panicbuy_list.js 4KB
card_verification.js 4KB
activating_card.js 4KB
verification.js 4KB
card.js 4KB
panicbuy_orderdetail.js 4KB
wxParse.js 4KB
htmlparser.js 3KB
withdraw.js 3KB
addcomment.js 3KB
my.js 3KB
ypuk_util.js 3KB
mypanicbuy.js 3KB
verification_record.js 3KB
mycard.js 2KB
mydiscountlog.js 2KB
distribution.js 2KB
card_verification_log.js 2KB
mytobusiness.js 2KB
myfav.js 2KB
business_top.js 2KB
base64.js 2KB
comment_list.js 2KB
image-lazyload-min.js 2KB
newsDetail.js 1KB
index.js 1KB
notice.js 1KB
login.js 411B
app.js 281B
index.js 253B
siteinfo.js 203B
app.json 2KB
verification_record.json 83B
mypanicbuy.json 83B
card_verification_log.json 54B
mydiscountlog.json 54B
card_verification.json 51B
mytobusiness.json 51B
myfav.json 51B
detail.json 48B
verification.json 48B
comment_list.json 48B
distribution.json 48B
panicbuy_detail.json 48B
addcomment.json 48B
withdraw.json 48B
buiness.json 48B
panicbuy_addorder.json 48B
notice.json 48B
business_top.json 48B
panicbuy_orderdetail.json 48B
mycard.json 45B
card.json 42B
paycard.json 42B
index.json 42B
共 292 条
- 1
- 2
- 3
资源评论
小小姑娘很大
- 粉丝: 4078
- 资源: 2321
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功