<?php
/**
* 码上点餐
*
* 作者:迷失卍国度
*
* qq : 15595755
*/
defined('IN_IA') or exit('Access Denied');
include "model.php";
include "plugin/feyin/HttpClient.class.php";
include "templateMessage.php";
include "fengniao.php";
include "plugin/yilianyun_Lib/Autoloader.php";
use App\Config\YlyConfig;
use App\Oauth\YlyOauthClient;
use App\Api\PrintService;
use App\Api\PicturePrintService;
use App\Api\ExpressPrintService;
include "plugin/jinyun_print/print.php";
define(EARTH_RADIUS, 6371); //地球半径,平均半径为6371km
define('RES', '../addons/weisrc_dish/template/');
define('CUR_MOBILE_DIR', 'dish/');
define('FEYIN_HOST', 'my.feyin.net');
define('FEYIN_PORT', 80);
define('FEIE_IP', 'dzp.feieyun.com');
define('FEIE_PORT', 80);
define('FEIE_HOSTNAME', '/FeieServer');
require 'inc/func/core.php';
include 'zipfile.php';
include 'huanghe_function.php';
include 'plugin/printerLib/Autoloader.php';
include 'plugin/printerLib/XpsdkPrintApiDemo.php';
include 'plugin/alidayu/SignatureHelper.php';
use Aliyun\DySDKLite\SignatureHelper;
class weisrc_dishModuleSite extends Core
{
public $global_sid = 0;
public $logo = '';
public $more_store_psize = 10;
function __construct()
{
global $_W, $_GPC;
// $this->serverip = getServerIP();
$this->_fromuser = $_W['fans']['from_user']; //debug
$host = $_SERVER['HTTP_HOST'];
if ($host == 'localhost' || $host == '127.0.0.1:81') {
$this->_fromuser = 'debug';
}
$this->_weid = $_W['uniacid'];
$account = $_W['account'];
$this->_auth2_openid = 'auth2_openid_' . $_W['uniacid'];
$this->_auth2_nickname = 'auth2_nickname_' . $_W['uniacid'];
$this->_auth2_headimgurl = 'auth2_headimgurl_' . $_W['uniacid'];
$this->_lat = 'lat_' . $this->_weid;
$this->_lng = 'lng_' . $this->_weid;
$this->_appid = '';
$this->_appsecret = '';
$this->_accountlevel = $account['level']; //是否为高级号
if (isset($_COOKIE[$this->_auth2_openid])) {
$this->_fromuser = $_COOKIE[$this->_auth2_openid];
}
if (isset($_COOKIE['global_sid_' . $_W['uniacid']])) {
$this->global_sid = $_COOKIE['global_sid_' . $_W['uniacid']];
}
if ($this->_accountlevel < 4) {
$setting = uni_setting($this->_weid);
$oauth = $setting['oauth'];
if (!empty($oauth) && !empty($oauth['account'])) {
$this->_account = account_fetch($oauth['account']);
$this->_appid = $this->_account['key'];
$this->_appsecret = $this->_account['secret'];
}
} else {
$this->_appid = $_W['account']['key'];
$this->_appsecret = $_W['account']['secret'];
}
$logo = pdo_fetch("SELECT site_logo FROM " . tablename($this->table_setting) . " WHERE weid = :weid", array
(':weid' => $this->_weid));
if (empty($logo['site_logo'])) {
$this->logo = '../addons/weisrc_dish/template/images/logo.png';
} else {
$this->logo = tomedia($logo['site_logo']);
}
$template = pdo_fetch("SELECT * FROM " . tablename($this->table_template) . " WHERE weid = :weid", array(':weid' => $this->_weid));
if (!empty($template)) {
$this->cur_tpl = $template['template_name'];
}
$this->cur_res = RES . '/mobile/' . $this->cur_tpl;
$this->cur_mobile_path = RES . '/mobile/' . $this->cur_tpl;
$this->_file_sys_tb();
// $sql = "
// CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_speaker` (
// `id` int(10) NOT NULL AUTO_INCREMENT,
// `weid` int(10) unsigned NOT NULL,
// `storeid` int(10) unsigned NOT NULL,
// `title` varchar(200) DEFAULT '',
// `sn` varchar(100) DEFAULT '' COMMENT '',
// `version` int(10) DEFAULT '1',
// `vol` int(10) DEFAULT '100',
// `speed` int(10) DEFAULT '65',
// `status` tinyint(1) DEFAULT '0',
// `dateline` int(10) DEFAULT '0',
// PRIMARY KEY (`id`)
//) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
// ";
// pdo_run($sql);
}
public function sendSpeaker($store, $order)
{
$settings = pdo_fetchall("SELECT * FROM " . tablename('weisrc_dish_speaker') . " WHERE storeid = :storeid AND status=1 ", array(':storeid' => $store['id']));
$ordertype = array(
'1' => '堂点',
'2' => '外卖',
'3' => '预定',
'4' => '快餐',
'5' => '收银',
'6' => '充值',
'7' => '开卡',
'8' => '门店卡充值'
);
foreach ($settings as $item => $value) {
$msg = '您有新的'.$ordertype[$order['dining_mode']] .'订单.请及时处理 ';
if ($order['dining_mode'] == 5) {
$msg = $store['title'] . '支付 ' . $order['totalprice']. '元';
}
$this->_speaker($value, $msg, $order['ordersn']);
}
}
public function _speaker($item, $message, $trace_no=""){
$url = "https://speaker.17laimai.cn/notify.php";
$dat = array(
'id'=>$item['sn'],
'message'=>$message,
'token'=> '105827801114',
'trace_no'=> $trace_no ? $trace_no : time().random(8),
'vol'=>$item['vol'],
'speed'=>$item['speed'],
'seq'=>time(),
'version'=>1
);
load()->func('communication');
$ires = ihttp_post($url,$dat);
if (is_error($ires)) {
return $ires;
}
$res = json_decode($ires['content'],true);
if ($res['errcode'] == 0) {
return error(0,'ok');
}else{
return error($res['errcode'],$res['errmsg'].$res['detail']);
}
}
public function doMobileMiniPayNotify()
{
global $_W, $_GPC;
$plid = intval($_GPC['plid']);
$orderid = intval($_GPC['orderid']);
file_put_contents(IA_ROOT . "/addons/weisrc_dish/wxpaynotify.log", var_export($_GPC, true) . PHP_EOL,
FILE_APPEND);
$paylog = pdo_fetch("SELECT * FROM ". tablename("core_paylog")." WHERE plid=:plid AND tid=:tid",array(':plid'=>$plid,':tid'=>$orderid));
$url = '../../app/' . $this->createMobileUrl('index', array());
if(empty($paylog)){
message('订单不存在',$url,'error');
}
if($paylog['status'] != 1){
message('订单未支付',$url,'error');
}
$tag = iunserializer($paylog['tag']);
$data['weid'] = $this->_weid;
$data['uniacid'] = $_W['uniacid'];
$data['acid'] = $_W['acid'];
$data['result'] = 'success';
$data['type'] = 'wechat';
$data['from'] = 'notify';
$data['tid'] = $paylog['tid'];
$data['uniontid'] = $paylog['uniontid'];
$data['transaction_id'] = $tag['transaction_id'];
$data['fee'] = $paylog['fee'];
$data['tag']['transaction_id'] = $tag['transaction_id'];
$data['orderid'] = $paylog['tid'];
$data['is_usecard'] = $paylog['is_usecard'];
$data['card_fee'] = $paylog['card_fee'];
$data['card_type'] = $paylog['card_type'];
$data['card_id'] = $paylog['card_id'];
$data['paytime'] = TIMESTAMP;
$this->payResult($data);
}
public function doMobileAmpayalipay()
{
global $_GPC, $_W;
$orderid = intval($_GPC['orderid']);
$order = $this->getOrderById($orderid);
if ($order) {
if ($this->isweixin() == 0) {
$url = $order['alipayurl'];
Header("Location: {$url}");
}
}
include $this->template($this->cur_tpl .
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
点餐系统小程序源码外卖餐饮系统公众号小程序(前后端) (1031个子文件)
style.css 152KB
custom.css 148KB
custom.css 148KB
style.css 118KB
light7.min.css 105KB
weui.css 98KB
weixin.css 93KB
weui.min.css 50KB
mobiscroll.custom-2.6.2.min.css 47KB
style.css 47KB
weui.min.css 46KB
wei_canyin_v1.8.4_xg.css 32KB
font-awesome.css 32KB
bootstrap-rtl.css 31KB
font.css 27KB
goods-two.css 27KB
font-awesome.min93e3.css 26KB
font-awesome.min.css 26KB
goods.css 26KB
wei_canyin_v1.8.4.css 25KB
order-new.css 24KB
tongcheng.css 23KB
hp.css 23KB
iconfont.css 21KB
main.css 21KB
font-awesome.css 21KB
iconfont.css 18KB
swiper.css 16KB
product.css 15KB
swiper.min.css 15KB
shop.css 14KB
address.css 13KB
user.css 11KB
main.css 11KB
style.css 11KB
common.css 10KB
goods-show.css 10KB
index.css 9KB
back.css 9KB
common.css 8KB
feedback.css 8KB
detail.css 8KB
menu.css 7KB
category.css 7KB
order-list.css 7KB
myfeed.css 7KB
awesome-bootstrap-checkbox.css 7KB
common.css 6KB
iconfont_v2.css 6KB
order.css 6KB
open-popupx.css 5KB
layer.css 5KB
layer.css 5KB
keep.css 5KB
wei_dialog_v1.2.1.css 4KB
reset.css 4KB
standalone.css 4KB
standalone.css 4KB
main.css 4KB
jquery.contextMenu.css 4KB
reset.css 4KB
iconfont.css 4KB
clockpicker.css 4KB
search.css 3KB
youhui.css 3KB
jquery.gritter.css 3KB
login.css 2KB
onepage-scroll.css 2KB
jquery-popups.css 2KB
points.css 2KB
style.css 2KB
api.css 2KB
poster.css 2KB
validate.css 1KB
fakeLoader.css 1KB
style.css 1KB
webuploader.css 937B
home-33.css 525B
font.eot 31KB
iconfont.eot 17KB
loading.gif 22KB
loading.gif 18KB
kf.gif 8KB
line.gif 748B
ie-spacer.gif 43B
tablelist.html 726KB
掏宝资源-一个专注于源码分享与微信小程序开发制作的平台.html 145KB
page-frame.html 113KB
list_1.html 83KB
list_2.html 73KB
list_3.html 64KB
menu.html 60KB
goodsdetail.html 59KB
order_detail.html 58KB
allorder_detail.html 57KB
index.html 56KB
allorder.html 46KB
tables.html 45KB
storecard.html 43KB
card.html 42KB
共 1031 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
Keanu_Reeves_
- 粉丝: 0
- 资源: 20
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功