Commit e06f50ec authored by chenzq's avatar chenzq

待办

parent beed40c6
...@@ -34,8 +34,6 @@ if (function_exists('longbing_check_redis')) { ...@@ -34,8 +34,6 @@ if (function_exists('longbing_check_redis')) {
function getCompanys($good_id){ function getCompanys($good_id){
$sql="SELECT c.id,c.short_name name FROM".tablename('longbing_company_company')." c LEFT JOIN ".tablename('longbing_company_goods_company')." g $sql="SELECT c.id,c.short_name name FROM".tablename('longbing_company_company')." c LEFT JOIN ".tablename('longbing_company_goods_company')." g
ON c.id=g.company_id WHERE g.good_id=$good_id and g.isdel=0 and c.status=1"; ON c.id=g.company_id WHERE g.good_id=$good_id and g.isdel=0 and c.status=1";
...@@ -82,6 +80,12 @@ if ($_GPC['action'] == 'edit') { ...@@ -82,6 +80,12 @@ if ($_GPC['action'] == 'edit') {
} }
} }
$sta_time = $_GPC['start_time'];
if($sta_time){
$data['start_time']=json_encode($sta_time,true);
}
if (isset($data['images'])) { if (isset($data['images'])) {
$data['images'] = implode(',', $data['images']); $data['images'] = implode(',', $data['images']);
} else { } else {
......
This diff is collapsed.
...@@ -99,6 +99,8 @@ function createQr3($image, $path, $uniacid) ...@@ -99,6 +99,8 @@ function createQr3($image, $path, $uniacid)
return false; return false;
} }
function getAccessToken2() function getAccessToken2()
{ {
global $_GPC; global $_GPC;
...@@ -280,7 +282,6 @@ if ($_GPC['action'] == 'addBoss') { ...@@ -280,7 +282,6 @@ if ($_GPC['action'] == 'addBoss') {
if ($user['is_staff'] != 1) { if ($user['is_staff'] != 1) {
message('该用户还不是员工', '', 'error'); message('该用户还不是员工', '', 'error');
} }
$result = pdo_update('longbing_company_user', array('status' => 1, 'is_staff' => 1, 'update_time' => time(), 'is_boss' => 1), array('id' => $_GPC['id'])); $result = pdo_update('longbing_company_user', array('status' => 1, 'is_staff' => 1, 'update_time' => time(), 'is_boss' => 1), array('id' => $_GPC['id']));
if ($result) { if ($result) {
...@@ -295,6 +296,9 @@ if ($_GPC['action'] == 'addBoss') { ...@@ -295,6 +296,9 @@ if ($_GPC['action'] == 'addBoss') {
message('设置失败', '', 'error'); message('设置失败', '', 'error');
} }
if ($_GPC['action'] == 'delBoss') { if ($_GPC['action'] == 'delBoss') {
$user = pdo_get('longbing_company_user', array('id' => $_GPC['id'])); $user = pdo_get('longbing_company_user', array('id' => $_GPC['id']));
......
...@@ -26,6 +26,9 @@ if($channel==3){ ...@@ -26,6 +26,9 @@ if($channel==3){
'is_level'=>0, 'is_level'=>0,
'channel'=>'线下' 'channel'=>'线下'
); );
// pdo_insert('longbing_card_usermember',$b); // pdo_insert('longbing_card_usermember',$b);
}elseif($channel==2){ }elseif($channel==2){
$b= array( $b= array(
...@@ -41,6 +44,7 @@ if($channel==3){ ...@@ -41,6 +44,7 @@ if($channel==3){
); );
} }
pdo_insert('longbing_card_usermember',$b); pdo_insert('longbing_card_usermember',$b);
return $this->result(0, '请求成功', array()); return $this->result(0, '请求成功', array());
...@@ -50,4 +54,9 @@ return $this->result(0, '请求成功', array()); ...@@ -50,4 +54,9 @@ return $this->result(0, '请求成功', array());
?> ?>
<?php
//dezend by http://www.yunlu99.com/
define('ROOT_PATH', IA_ROOT . '/addons/longbing_company/');
is_file(ROOT_PATH . '/inc/we7.php') || exit('Access Denied Longbing');
require_once ROOT_PATH . '/inc/we7.php';
global $_GPC;
global $_W;
$uniacid = $_W['uniacid'];
$uid = $_GPC['user_id'];
$type = $_GPC['type'];
$time = $_GPC['search_time'];
if (!$type) {
$type = 0;
}
$limit = array(1, 5);
$curr = 1;
if (isset($_GPC['page'])) {
$limit[0] = $_GPC['page'];
$curr = $_GPC['page'];
}
$where = array('uniacid' => $uniacid, 'status !=' => -1, 'user_id' => $uid);
$collage_overtime = 172800;
$info = pdo_get('longbing_company_config', array('uniacid' => $_W['uniacid']), array('collage_overtime'));
$collage_overtime = $info['collage_overtime'];
$tu = pdo_get('longbing_company_user_info',array('fans_id'=>$uid));
if (!$collage_overtime) {
$collage_overtime = 172800;
}
switch ($type) {
case 1:
$where['pay_status'] = 1;
$where['order_status'] = 0;
$where['company_id']=$tu['company_id'];
break;
case 2:
$where['pay_status'] = 1;
$where['order_status'] = 3;
$where['company_id']=$tu['company_id'];
break;
case 3:
$where['pay_status'] = 1;
$where['company_id']=$tu['company_id'];
break;
}
$list = pdo_getslice('longbing_company_shop_order', $where, $limit, $count, array(), '', array('id desc'));
//print_r($list);die;
foreach ($list as $k => $v) {
$sql = 'SELECT a.id,a.order_id,a.goods_id,a.name,a.cover,a.number,a.total_price,a.price,a.content,a.qr_code,b.id,b.unit FROM ' . tablename('longbing_company_shop_order_item') . ' a LEFT JOIN ' . tablename('longbing_company_goods') . (' b ON a.goods_id = b.id WHERE a.order_id = ' . $v['id'] . ' && a.uniacid = ' . $uniacid);
$goods_info = pdo_fetchall($sql);
foreach ($goods_info as $k2 => $v2) {
$goods_info[$k2]['cover_true'] = tomedia($v2['cover']);
}
$list[$k]['goods_info'] = $goods_info;
}
$data = array('page' => $curr, 'total_page' => ceil($count / 5), 'list' => $list);
return $this->result(0, '', $data);
?>
\ No newline at end of file
<?php
define('ROOT_PATH', IA_ROOT . '/addons/longbing_company/');
is_file(ROOT_PATH . '/inc/we7.php') || exit('Access Denied Longbing');
require_once ROOT_PATH . '/inc/we7.php';
global $_GPC;
global $_W;
$uniacid = $_W['uniacid'];
$module_name = $_W['current_module']['name'];
$order_id = $_GPC['order_id'];
$uid=$_GPC['user_id'];
$er = pdo_get('longbing_company_user',array('id'=>$uid));
if($er['permission']==1) {
if ($order_id) {
$a = pdo_update('longbing_company_shop_order', array('order_status' => 3), array('id' => $order_id, 'pay_status' => 1));
if (!empty($a)) {
return $this->result(0, '审核成功', array());
}
return $this->result(-1, '审核失败', array());
}
return $this->result(-1, '订单号为空', array());
}
return $this->result(-1, '没有扫码权限', array());
?>
\ No newline at end of file
<?php
//dezend by http://www.yunlu99.com/
define('ROOT_PATH', IA_ROOT . '/addons/longbing_company/');
is_file(ROOT_PATH . '/inc/we7.php') || exit('Access Denied Longbing');
define('LOGGING_TRACE', 'trace');
require_once ROOT_PATH . '/inc/we7.php';
global $_GPC;
global $_W;
$uniacid = $_W['uniacid'];
$uid = $_GPC['user_id'];
$id = $_GPC['id'];
//if (!$uid || !$id) {
// return $this->result(-1, '', array());
//}
$r=pdo_get('longbing_company_user',array('id'=>$uid));
if($r['permission']==1) {
$where = array('uniacid' => $uniacid, 'id' => $id);
$info = pdo_get('longbing_company_shop_order', $where);
if (!$info) {
return $this->result(-1, '', array());
}
$sql = 'SELECT a.id,a.order_id,a.goods_id,a.name,a.cover,a.number,a.price,a.trip_time,a.company_id,a.company_name,a.spe_price_id,b.id,b.unit FROM ' . tablename('longbing_company_shop_order_item') . ' a LEFT JOIN ' . tablename('longbing_company_goods') . (' b ON a.goods_id = b.id WHERE a.order_id = ' . $id . ' && a.uniacid = ' . $uniacid);
$goods_info = pdo_fetchall($sql);
foreach ($goods_info as $k => $v) {
$goods_info[$k]['cover_true'] = tomedia($v['cover']);
$spe_price = pdo_get('longbing_company_shop_spe_price', array('id' => $v['spe_price_id'], 'uniacid' => $uniacid));
$spe_id_1 = $spe_price['spe_id_1'];
$arr = explode('-', $spe_id_1);
$str = implode(',', $arr);
if (strpos($str, ',')) {
$str = '(' . $str . ')';
$sql = 'SELECT * FROM ' . tablename('longbing_company_shop_spe') . (' WHERE id IN ' . $str);
} else {
$sql = 'SELECT * FROM ' . tablename('longbing_company_shop_spe') . (' WHERE id = ' . $str);
}
$speList = pdo_fetchall($sql);
$titles = '';
foreach ($speList as $k2 => $v2) {
$titles .= '-' . $v2['title'];
}
$titles = trim($titles, '-');
$goods_info[$k]['titles'] = $titles;
}
if ($info['type'] == 1) {
$collage = pdo_get('longbing_company_shop_collage_list', array('id' => $info['collage_id']));
$info['collage_info'] = $collage;
$users = pdo_getall('longbing_company_shop_user_collage', array('collage_id' => $info['collage_id']), array('user_id'), '', array('id asc'));
$ids = '';
foreach ($users as $k2 => $v2) {
$ids .= ',' . $v2['user_id'];
}
$ids = trim($ids, ',');
if (1 < count($users)) {
$ids = '(' . $ids . ')';
$sql = 'SELECT id, nickName, `avatarUrl` FROM ' . tablename('longbing_company_user') . (' WHERE uniacid = ' . $uniacid . ' && id in ' . $ids);
} else {
$sql = 'SELECT id, nickName, `avatarUrl` FROM ' . tablename('longbing_company_user') . (' WHERE uniacid = ' . $uniacid . ' && id = ' . $ids);
}
$users = pdo_fetchall($sql);
$info['users'] = array();
foreach ($users as $k2 => $v2) {
if ($v2['id'] == $collage['user_id']) {
$info['own'] = $v2;
} else {
$info['users'][] = $v2;
}
}
}
$info['goods_info'] = $goods_info;
if ($info['pay_status'] == 0) {
$left_time = 172800 - (time() - $info['create_time']);
$info['left_time'] = $left_time;
}
//$user_info = pdo_get('longbing_company_user_info', array('fans_id' => $info['to_uid']));
$user_info['avatar_true'] = tomedia($user_info['avatar']);
$info['user_info'] = $user_info;
return $this->result(0, '', $info);
}
return $this->result(-1, '没有扫码权限', array());
?>
\ No newline at end of file
...@@ -141,9 +141,9 @@ $to_uid = $_GPC['to_uid']; ...@@ -141,9 +141,9 @@ $to_uid = $_GPC['to_uid'];
$goods_id = $_GPC['goods_id']; $goods_id = $_GPC['goods_id'];
//$d = $_GPC['m_price']; //$d = $_GPC['m_price'];
$is_member = $_GPC['is_member']; $is_member = $_GPC['is_member'];
if (!$to_uid) { //if (!$to_uid) {
return $this->result(-1, '不存在to_uid', array()); // return $this->result(-1, '不存在to_uid', array());
} //}
$u = pdo_get('longbing_company_user',array("id"=>$uid)); $u = pdo_get('longbing_company_user',array("id"=>$uid));
...@@ -195,6 +195,7 @@ if($level>0){ ...@@ -195,6 +195,7 @@ if($level>0){
} }
} }
$goods['start_time']=json_decode($goods['start_time']);
$goods['companyList']=getCompanys($goods['id']); $goods['companyList']=getCompanys($goods['id']);
$goods['spe_list'] = $speList; $goods['spe_list'] = $speList;
$spe_price = pdo_getall('longbing_company_shop_spe_price', array('goods_id' => $goods_id, 'status' => 1, 'uniacid' => $uniacid), array('id', 'spe_id_1', 'price', 'stock')); $spe_price = pdo_getall('longbing_company_shop_spe_price', array('goods_id' => $goods_id, 'status' => 1, 'uniacid' => $uniacid), array('id', 'spe_id_1', 'price', 'stock'));
...@@ -339,7 +340,7 @@ if($level>0){ ...@@ -339,7 +340,7 @@ if($level>0){
return $this->result(-1, '', array('id' => $goods_id)); return $this->result(-1, '', array('id' => $goods_id));
} }
$goods['start_time']=json_decode($goods['start_time']);
$goods['cover_true'] = tomedia($goods['cover']); $goods['cover_true'] = tomedia($goods['cover']);
$goods['images_true'] = array(); $goods['images_true'] = array();
$images = $goods['images']; $images = $goods['images'];
...@@ -585,7 +586,7 @@ if($level>0){ ...@@ -585,7 +586,7 @@ if($level>0){
$titles = trim($titles, '-'); $titles = trim($titles, '-');
$collage[$k]['titles'] = $titles; $collage[$k]['titles'] = $titles;
} }
$goods['start_time']=json_decode($goods['start_time']);
$goods['collage'] = $collage; $goods['collage'] = $collage;
$destination_folder = '/images' . ('/longbing_company/' . $_W['uniacid']); $destination_folder = '/images' . ('/longbing_company/' . $_W['uniacid']);
$image = $destination_folder . '/' . $_W['uniacid'] . '-goods-' . $goods_id . '-' . $to_uid . 'qr.png'; $image = $destination_folder . '/' . $_W['uniacid'] . '-goods-' . $goods_id . '-' . $to_uid . 'qr.png';
......
...@@ -58,7 +58,7 @@ case 4: ...@@ -58,7 +58,7 @@ case 4:
$list = pdo_getslice('longbing_company_shop_order', $where, $limit, $count, array(), '', array('id desc')); $list = pdo_getslice('longbing_company_shop_order', $where, $limit, $count, array(), '', array('id desc'));
foreach ($list as $k => $v) { foreach ($list as $k => $v) {
$sql = 'SELECT a.id,a.order_id,a.goods_id,a.name,a.cover,a.number,a.total_price,a.content,b.id,b.unit FROM ' . tablename('longbing_company_shop_order_item') . ' a LEFT JOIN ' . tablename('longbing_company_goods') . (' b ON a.goods_id = b.id WHERE a.order_id = ' . $v['id'] . ' && a.uniacid = ' . $uniacid); $sql = 'SELECT a.id,a.order_id,a.goods_id,a.name,a.cover,a.number,a.total_price,a.price,a.content,a.qr_code,b.id,b.unit,b.is_free_card FROM ' . tablename('longbing_company_shop_order_item') . ' a LEFT JOIN ' . tablename('longbing_company_goods') . (' b ON a.goods_id = b.id WHERE a.order_id = ' . $v['id'] . ' && a.uniacid = ' . $uniacid);
$goods_info = pdo_fetchall($sql); $goods_info = pdo_fetchall($sql);
foreach ($goods_info as $k2 => $v2) { foreach ($goods_info as $k2 => $v2) {
......
...@@ -59,8 +59,12 @@ if ($info['pay_status'] == 0 && $info['order_status'] != 1) { ...@@ -59,8 +59,12 @@ if ($info['pay_status'] == 0 && $info['order_status'] != 1) {
$sql = 'SELECT a.id,a.order_id,a.goods_id,a.name,a.cover,a.number,a.price,a.trip_time,a.company_id,a.company_name,a.spe_price_id,b.id,b.unit FROM ' . tablename('longbing_company_shop_order_item') . ' a LEFT JOIN ' . tablename('longbing_company_goods') . (' b ON a.goods_id = b.id WHERE a.order_id = ' . $id . ' && a.uniacid = ' . $uniacid); $sql = 'SELECT a.id,a.order_id,a.goods_id,a.name,a.cover,a.number,a.price,a.trip_time,a.company_id,a.company_name,a.spe_price_id,a.qr_code,b.id FROM ' . tablename('longbing_company_shop_order_item') . ' a LEFT JOIN ' . tablename('longbing_company_goods') . (' b ON a.goods_id = b.id WHERE a.order_id = ' . $id . ' && a.uniacid = ' . $uniacid);
$goods_info = pdo_fetchall($sql); $goods_info = pdo_fetchall($sql);
$fg = pdo_get('longbing_company_shop_order_item',array('order_id'=>$id));
$is_vip=pdo_get('longbing_company_goods',array('id'=>$fg['goods_id']));
foreach ($goods_info as $k => $v) { foreach ($goods_info as $k => $v) {
$goods_info[$k]['cover_true'] = tomedia($v['cover']); $goods_info[$k]['cover_true'] = tomedia($v['cover']);
...@@ -86,6 +90,9 @@ foreach ($goods_info as $k => $v) { ...@@ -86,6 +90,9 @@ foreach ($goods_info as $k => $v) {
$titles = trim($titles, '-'); $titles = trim($titles, '-');
$goods_info[$k]['titles'] = $titles; $goods_info[$k]['titles'] = $titles;
$goods_info[$k]['is_free_card'] = $is_vip['is_free_card'];
} }
if ($info['type'] == 1) { if ($info['type'] == 1) {
...@@ -133,4 +140,5 @@ $user_info['avatar_true'] = tomedia($user_info['avatar']); ...@@ -133,4 +140,5 @@ $user_info['avatar_true'] = tomedia($user_info['avatar']);
$info['user_info'] = $user_info; $info['user_info'] = $user_info;
return $this->result(0, '', $info); return $this->result(0, '', $info);
?> ?>
<?php
define('ROOT_PATH', IA_ROOT . '/addons/longbing_company/');
is_file(ROOT_PATH . '/inc/we7.php') || exit('Access Denied Longbing');
require_once ROOT_PATH . '/inc/we7.php';
global $_GPC;
global $_W;
$uniacid = $_W['uniacid'];
$module_name = $_W['current_module']['name'];
$order_id = $_GPC['order_id'];
$uid=$_GPC['user_id'];
function getAccessToken2()
{
global $_GPC;
global $_W;
$appid = $_W['account' ]['key'];
$appsecret = $_W['account']['secret'];
$appidMd5 = md5($appid);
if (!is_file(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt')) {
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $appid . '&secret=' . $appsecret;
$data = ihttp_get($url);
$data = json_decode($data['content'], true);
if (!isset($data['access_token'])) {
return false;
}
$access_token = $data['access_token'];
file_put_contents(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt', json_encode(array('at' => $access_token, 'time' => time() + 6200)));
return $access_token;
}
if (is_file(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt')) {
$fileInfo = file_get_contents(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt');
if (!$fileInfo) {
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $appid . '&secret=' . $appsecret;
$data = ihttp_get($url);
$data = json_decode($data['content'], true);
if (!isset($data['access_token'])) {
return false;
}
$access_token = $data['access_token'];
file_put_contents(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt', json_encode(array('at' => $access_token, 'time' => time() + 6200)));
return $access_token;
}
$fileInfo = json_decode($fileInfo, true);
if ($fileInfo['time'] < time()) {
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $appid . '&secret=' . $appsecret;
$data = ihttp_get($url);
$data = json_decode($data['content'], true);
if (!isset($data['access_token'])) {
return false;
}
$access_token = $data['access_token'];
file_put_contents(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt', json_encode(array('at' => $access_token, 'time' => time() + 6200)));
return $access_token;
}
return $fileInfo['at'];
}
return false;
}
global $_W;
$u = pdo_get('longbing_company_user',array('id'=>$uid));
load()->func('file');
if (!is_dir(ATTACHMENT_ROOT . '/' . 'images')) {
mkdir(ATTACHMENT_ROOT . '/' . 'images');
}
if (!is_dir(ATTACHMENT_ROOT . '/' . 'images/longbing_company')) {
mkdir(ATTACHMENT_ROOT . '/' . 'images/longbing_company');
}
if (!is_dir(ATTACHMENT_ROOT . '/' . ('images/longbing_company/' . $_W['uniacid'] . '/'))) {
mkdir(ATTACHMENT_ROOT . '/' . ('images/longbing_company/' . $_W['uniacid'] . '/'));
}
$destination_folder = ATTACHMENT_ROOT . '/images' . ('/longbing_company/' . $_W['uniacid']);
$image = $destination_folder . '/' . $_W['uniacid'] . '-' .$order_id .'qr.png';
$path = '/longbing_company/users/pages/uCenter/order/orderDetail/orderDetail?orderId='.$order_id;
$res = $this->createQr($image, $path);
$image = tomedia('images' . ('/longbing_company/' . $_W['uniacid'] . '/') . $_W['uniacid'] . '-' .$order_id. 'qr.png');
if (!strstr($image, 'ttp')) {
$image = 'https://' . $image;
}
//pdo_update('longbing_company_user', array('qr_path' => 'images' . ('/longbing_company/' . $_W['uniacid'] . '/') . $_W['uniacid'] . '-' . $to_uid . 'qr.png'), array('id' => $to_uid));
$image = $this->transImage($image);
if(!empty($image)) {
return $this->result(0, '成功生成二维码', $image, array());
//print_r($image);die;
}
return $this->result(-1, '生成二维码失败', array());
?>
\ No newline at end of file
...@@ -81,6 +81,8 @@ class longbing_companyModule extends WeModule ...@@ -81,6 +81,8 @@ class longbing_companyModule extends WeModule
$couponList = $this->createWebUrl('manage/coupon'); $couponList = $this->createWebUrl('manage/coupon');
$groupSending = $this->createWebUrl('manage/groupsending'); $groupSending = $this->createWebUrl('manage/groupsending');
$handover = $this->createWebUrl('manage/handover'); $handover = $this->createWebUrl('manage/handover');
$permission = $this->createWebUrl('manage/permission');
$profitList = $this->createWebUrl('manage/profit'); $profitList = $this->createWebUrl('manage/profit');
$waterList = $this->createWebUrl('manage/water'); $waterList = $this->createWebUrl('manage/water');
$cashList = $this->createWebUrl('manage/cash'); $cashList = $this->createWebUrl('manage/cash');
......
...@@ -328,15 +328,13 @@ ...@@ -328,15 +328,13 @@
</div> </div>
</div>--> </div>-->
<div class="layui-inline" style="float: left"> <div class="layui-inline" style="float: left">
<label class="layui-form-label">时间范围</label> <label class="layui-form-label">出发时间</label>
<div class="layui-input-inline"> <div class="layui-input-inline add">
<input type="text" value="" class="layui-input" name="start_time" id="StartTime" placeholder="年-月-日" > <input type="text" value="" class="layui-input" name="start_time" id="StartTime" placeholder="年-月-日" >
</div> </div>
<div class="layui-input-inline"> <div style="clear: both;padding-top: 15px;"><button class="layui-btn" onclick="dayHtml();return false;">+添加</button></div>
<input type="text" value="" class="layui-input" name="end_time" id="EndTime" placeholder="年-月-日">
</div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">设为推荐</label> <label class="layui-form-label">设为推荐</label>
...@@ -410,7 +408,19 @@ ...@@ -410,7 +408,19 @@
<span class="span-remark">设为推荐则该商品折扣价</span> <span class="span-remark">设为推荐则该商品折扣价</span>
</div> </div>
</div> </div>
<div class="layui-form-item">
<label class="layui-form-label">设为预约租车</label>
<div class="layui-input-block">
{if $info['is_make'] == 1}
<input type="radio" name="is_make" value="1" title="是" checked>
<input type="radio" name="is_make" value="0" title="否">
{else}
<input type="radio" name="is_make" value="1" title="是">
<input type="radio" name="is_make" value="0" title="否" checked>
{/if}
<span class="span-remark">设为预约租车</span>
</div>
</div>
...@@ -449,6 +459,35 @@ ...@@ -449,6 +459,35 @@
<script src="../../../addons/{$module_name}/images/layuiadmin/layui/layui.js"></script> <script src="../../../addons/{$module_name}/images/layuiadmin/layui/layui.js"></script>
<script> <script>
function dayHtml(){
var html = "";
html+='<div class="layui-input-inline" style="width: 100px;">';
html+='<input type="text" name="start_time" Id="StartTime" class="layui-input" placeholder="年-月-日" />';
html+='</div>';
$(".add").append(html);
}
function getDatas(){
var l = $(".dayHtml input[name='start_time']").size();
if(l==0){
return "";
}else{
var jsonList = [];
for(var i=0;i<l;i++){
$day=$(".dayHtml input[name='start_time']").eq(i).val();
// $point=$(".dayHtml input[name='dayVal']").eq(i).val();
if($day){
jsonList[i]={
"day":$day,
}
}
}
return jsonList;
}
}
function nums(e){ function nums(e){
if(e>9){ if(e>9){
return e; return e;
...@@ -518,12 +557,8 @@ ...@@ -518,12 +557,8 @@
var start_timeD = new Date(formData.start_time); var start_timeD = new Date(formData.start_time);
formData.start_time=start_timeD.getTime()/1000; formData.start_time=start_timeD.getTime()/1000;
} }
if(formData.end_time){
var end_timeD = new Date(formData.end_time);
formData.end_time=end_timeD.getTime()/1000;
}
var url = "{php echo $this->createWebUrl('manage/goodsedit')}";
var url = "{php echo $this->createWebUrl('manage/goodsedit')}";
var id = '{$id}'; var id = '{$id}';
var data = { var data = {
action: 'edit', action: 'edit',
...@@ -533,6 +568,7 @@ ...@@ -533,6 +568,7 @@
if (id > 0) { if (id > 0) {
data.id = id; data.id = id;
} }
postData(url, data); postData(url, data);
return false; return false;
......
...@@ -165,6 +165,19 @@ ...@@ -165,6 +165,19 @@
</a> </a>
</li> </li>
<li data-name="handover" class="layui-nav-item">
<a href="javascript:;" lay-href="{$permission}" lay-tips="</a>" lay-direction="2">
<!--<i class="layui-icon layui-icon-set" style="color: #898989"></i>-->
<img src="https://retail.xiaochengxucms.com/images/2/2018/12/NdEO9U4zo3c307oZJs9656osj2j6e4.png" class="icon-img">
<cite style="color: #898989">员工权限</cite>
</a>
</li>
<li data-name="goods" class="layui-nav-item"> <li data-name="goods" class="layui-nav-item">
<a href="javascript:;" lay-tips="商品管理" lay-direction="2"> <a href="javascript:;" lay-tips="商品管理" lay-direction="2">
<!--<i class="layui-icon layui-icon-component" style="color: #898989"></i>--> <!--<i class="layui-icon layui-icon-component" style="color: #898989"></i>-->
......
This diff is collapsed.
...@@ -70,7 +70,6 @@ ...@@ -70,7 +70,6 @@
{else} {else}
{if $item['is_staff'] == 1} {if $item['is_staff'] == 1}
{if $item['is_stock'] == 1} {if $item['is_stock'] == 1}
<td><span class="layui-badge layui-bg-blue">股东</span></td> <td><span class="layui-badge layui-bg-blue">股东</span></td>
{else} {else}
<td><span class="layui-badge layui-bg-blue">员工</span></td> <td><span class="layui-badge layui-bg-blue">员工</span></td>
......
...@@ -9528,6 +9528,7 @@ class longbing_companyModuleWxapp extends WeModuleWxapp ...@@ -9528,6 +9528,7 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
public function payResult($log) public function payResult($log)
{ {
global $_GPC;
global $_W; global $_W;
if ($log['result'] == 'success' && $log['tid']) { if ($log['result'] == 'success' && $log['tid']) {
$out_trade_no = $log['tid']; $out_trade_no = $log['tid'];
...@@ -9570,7 +9571,6 @@ class longbing_companyModuleWxapp extends WeModuleWxapp ...@@ -9570,7 +9571,6 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
pdo_update('longbing_company_goods', array('collage_count +=' => $v['number']), array('id' => $v['goods_id'])); pdo_update('longbing_company_goods', array('collage_count +=' => $v['number']), array('id' => $v['goods_id']));
} }
} }
$mark = pdo_get('longbing_company_user_mark', array('user_id' => $order['user_id'], 'staff_id' => $order['to_uid'])); $mark = pdo_get('longbing_company_user_mark', array('user_id' => $order['user_id'], 'staff_id' => $order['to_uid']));
if (!$mark) { if (!$mark) {
...@@ -9616,6 +9616,40 @@ class longbing_companyModuleWxapp extends WeModuleWxapp ...@@ -9616,6 +9616,40 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
} }
global $_W;
//$u = pdo_get('longbing_company_user',array('id'=>$uid));
load()->func('file');
if (!is_dir(ATTACHMENT_ROOT . '/' . 'images')) {
mkdir(ATTACHMENT_ROOT . '/' . 'images');
}
if (!is_dir(ATTACHMENT_ROOT . '/' . 'images/longbing_company')) {
mkdir(ATTACHMENT_ROOT . '/' . 'images/longbing_company');
}
if (!is_dir(ATTACHMENT_ROOT . '/' . ('images/longbing_company/' . $_W['uniacid'] . '/'))) {
mkdir(ATTACHMENT_ROOT . '/' . ('images/longbing_company/' . $_W['uniacid'] . '/'));
}
$destination_folder = ATTACHMENT_ROOT . '/images' . ('/longbing_company/' . $_W['uniacid']);
$image = $destination_folder . '/' . $_W['uniacid'] . '-' .$order['id'] .'qr.png';
$path = '/longbing_company/users/pages/uCenter/order/orderDetail/orderDetail?orderId='.$order_id;
$res = $this->createQr($image, $path);
$image = tomedia('images' . ('/longbing_company/' . $_W['uniacid'] . '/') . $_W['uniacid'] . '-' .$order['id']. 'qr.png');
if (!strstr($image, 'ttp')) {
$image = 'https://' . $image;
}
//pdo_update('longbing_company_user', array('qr_path' => 'images' . ('/longbing_company/' . $_W['uniacid'] . '/') . $_W['uniacid'] . '-' . $to_uid . 'qr.png'), array('id' => $to_uid));
$image = $this->transImage($image);
if(!empty($image)) {
pdo_update('longbing_company_shop_order_item',array('qr_code'=>$image),array('order_id'=>$order['id']));
pdo_update('longbing_company_shop_order',array('qr_code'=>$image),array('id'=>$order['id']));
//return $this->result(0, '成功生成二维码', $image, array());
//print_r($image);die;
}
return $this->result(-1, '生成二维码失败', array());
} }
return false; return false;
...@@ -10063,6 +10097,75 @@ class longbing_companyModuleWxapp extends WeModuleWxapp ...@@ -10063,6 +10097,75 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
{ {
exit(json_encode(array('errno' => $errno, 'message' => $message, 'data' => $data), JSON_UNESCAPED_UNICODE)); exit(json_encode(array('errno' => $errno, 'message' => $message, 'data' => $data), JSON_UNESCAPED_UNICODE));
} }
function getAccessToken2()
{
global $_GPC;
global $_W;
$appid = $_W['account' ]['key'];
$appsecret = $_W['account']['secret'];
$appidMd5 = md5($appid);
if (!is_file(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt')) {
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $appid . '&secret=' . $appsecret;
$data = ihttp_get($url);
$data = json_decode($data['content'], true);
if (!isset($data['access_token'])) {
return false;
}
$access_token = $data['access_token'];
file_put_contents(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt', json_encode(array('at' => $access_token, 'time' => time() + 6200)));
return $access_token;
}
if (is_file(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt')) {
$fileInfo = file_get_contents(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt');
if (!$fileInfo) {
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $appid . '&secret=' . $appsecret;
$data = ihttp_get($url);
$data = json_decode($data['content'], true);
if (!isset($data['access_token'])) {
return false;
}
$access_token = $data['access_token'];
file_put_contents(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt', json_encode(array('at' => $access_token, 'time' => time() + 6200)));
return $access_token;
}
$fileInfo = json_decode($fileInfo, true);
if ($fileInfo['time'] < time()) {
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $appid . '&secret=' . $appsecret;
$data = ihttp_get($url);
$data = json_decode($data['content'], true);
if (!isset($data['access_token'])) {
return false;
}
$access_token = $data['access_token'];
file_put_contents(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt', json_encode(array('at' => $access_token, 'time' => time() + 6200)));
return $access_token;
}
return $fileInfo['at'];
}
return false;
}
} }
?> ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment