Commit da35f78e authored by chenzq's avatar chenzq

修改提交

parent fb6b6846
...@@ -53,7 +53,7 @@ LEFT JOIN ims_longbing_company_goods g ON m.good_id=g.id ...@@ -53,7 +53,7 @@ LEFT JOIN ims_longbing_company_goods g ON m.good_id=g.id
WHERE m.isdel=0 and m.uniacid=$uniacid "; WHERE m.isdel=0 and m.uniacid=$uniacid ";
$lists=pdo_fetchall($sql); $lists=pdo_fetchall($sql);
$count=count($lists); $count=count($lists);
$sql.=" ORDER BY m.cre_time LIMIT $page,$perPage"; $sql.=" ORDER BY m.cre_time desc LIMIT $page,$perPage";
$list=pdo_fetchall($sql); $list=pdo_fetchall($sql);
load()->func('tpl'); load()->func('tpl');
include $this->template('manage/make'); include $this->template('manage/make');
......
...@@ -9,14 +9,18 @@ global $_W; ...@@ -9,14 +9,18 @@ global $_W;
$uniacid = $_W['uniacid']; $uniacid = $_W['uniacid'];
$uid = $_GPC['user_id']; $uid = $_GPC['user_id'];
$type = $_GPC['type']; $type = $_GPC['type'];
$time = strtotime($_GPC['time']); if(isset($_GPC['time'])){
$time = strtotime(trim($_GPC['time']));
}else{
$time= strtotime(date('Y-m-d',time()));
}
print_r($time);die;
if (!$type) { if (!$type) {
$type = 0; $type = 0;
} }
$limit = array(1, 5); $limit = array(1, 10);
$curr = 1; $curr = 1;
if (isset($_GPC['page'])) { if (isset($_GPC['page'])) {
...@@ -30,42 +34,58 @@ $info = pdo_get('longbing_company_config', array('uniacid' => $_W['uniacid']), a ...@@ -30,42 +34,58 @@ $info = pdo_get('longbing_company_config', array('uniacid' => $_W['uniacid']), a
$collage_overtime = $info['collage_overtime']; $collage_overtime = $info['collage_overtime'];
$tu = pdo_get('longbing_company_user_info',array('fans_id'=>$uid)); $tu = pdo_get('longbing_company_user_info',array('fans_id'=>$uid));
$t = $tu['company_id']; $t = $tu['company_id'];
//print_r($tu);die;
$com =pdo_get('longbing_company_company',array('id'=>$tu['company_id'])); $com =pdo_get('longbing_company_company',array('id'=>$tu['company_id']));
if (!$collage_overtime) { if (!$collage_overtime) {
$collage_overtime = 172800; $collage_overtime = 172800;
} }
$sql="SELECT * FROM ims_longbing_company_shop_order where ";
if($time==''){
$time= date('Y-m-d', time());
}
switch ($type) { switch ($type) {
//未上车 //未上车
case 1: case 1:
$where['pay_status'] = 1; $sql.="pay_status=1 and order_status=0 and company_id=$t and trip_time=$time";
$where['order_status'] = 0;
$where['company_id'] = $t;
// $where['trip_time'] = $time;
break; break;
//已上车 //已上车
case 2: case 2:
$where['pay_status'] = 1; $sql.="pay_status=1 and order_status=3 and company_id=$t and trip_time=$time";
$where['order_status'] = 3;
//$where['company_id'] = $tu['company_id'];
//$where['trip_time'] = $time;
break; break;
//总计 //总计
case 3: case 3:
$where['pay_status'] = 1; $sql.="pay_status=1 and company_id=$t and trip_time=$time";
//$where['company_id'] = $tu['company_id'];
//$where['trip_time'] = $time;
break; break;
} }
$sql1="SELECT
o.order_status,IFNULL(sum(i.number),0) number
FROM ims_longbing_company_shop_order o left JOIN
ims_longbing_company_shop_order_item i on o.id=i.order_id
WHERE o.trip_time=$time and o.pay_status=1 and o.company_id=$t
GROUP BY o.order_status";
$lits=pdo_fetchall($sql);
$numbers=pdo_fetchall($sql1);
$number1=0;
$number2=0;
if($numbers){
foreach ($numbers as $k => $v) {
if($v['order_status']==0) {
$number1 =$v['number'];
continue;
}
if($v['order_status']==3) {
$number2 =$v['number'];
continue;
}
$list = pdo_getslice('longbing_company_shop_order', $where, $limit, $count, array(),'', array('id desc')); }
}
$count=count($lits);
$pageSize=$limit[1];
$pages=($curr-1)*$pageSize;
$sql.=" order by id desc limit $pages,$pageSize";
//$list = pdo_getslice('longbing_company_shop_order', $where, $limit, $count, array(),'', array('id desc'));
$list=pdo_fetchall($sql);
$ids=array();
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.price,a.content,a.qr_code,a.company_name,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,a.company_name,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); $goods_info = pdo_fetchall($sql);
...@@ -82,7 +102,7 @@ if($time==''){ ...@@ -82,7 +102,7 @@ if($time==''){
$list[$k]['user_company'] = $com['short_name']; $list[$k]['user_company'] = $com['short_name'];
} }
$data = array('page' => $curr, 'count' => $count, 'total_page' => ceil($count / 5), 'list' => $list,'company_name'=>$com['short_name']); $data = array('page' => $curr, 'count' => $count,'number1' => $number1,'number2' => $number2, 'total_page' => ceil($count / 10), 'list' => $list,'company_name'=>$com['short_name']);
return $this->result(0, '', $data); return $this->result(0, '', $data);
......
...@@ -54,7 +54,7 @@ LEFT JOIN ims_longbing_company_goods g ON m.good_id=g.id ...@@ -54,7 +54,7 @@ LEFT JOIN ims_longbing_company_goods g ON m.good_id=g.id
WHERE m.isdel=0 and m.user_id=$user_id and m.uniacid=$uniacid "; WHERE m.isdel=0 and m.user_id=$user_id and m.uniacid=$uniacid ";
$lists=pdo_fetchall($sql); $lists=pdo_fetchall($sql);
$count=count($lists); $count=count($lists);
$sql.=" ORDER BY m.cre_time LIMIT $page,$size"; $sql.=" ORDER BY desc m.cre_time LIMIT $page,$size";
$list=pdo_fetchall($sql); $list=pdo_fetchall($sql);
$data = array('page' => $curr, 'total_page' => ceil($count / 10), 'list' => $list,'url'=>$_W['siteroot'] . $_W['config']['upload']['attachdir'] . '/'); $data = array('page' => $curr, 'total_page' => ceil($count / 10), 'list' => $list,'url'=>$_W['siteroot'] . $_W['config']['upload']['attachdir'] . '/');
......
...@@ -144,9 +144,9 @@ $is_member = $_GPC['is_member']; ...@@ -144,9 +144,9 @@ $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));
......
...@@ -263,7 +263,7 @@ ...@@ -263,7 +263,7 @@
form.render('select'); form.render('select');
//getSelectCompany(e[0].id) //getSelectCompany(e[0].id)
} }
获取公司 //获取公司
function getSelectCompany(id){ function getSelectCompany(id){
ajaxFun({ ajaxFun({
url:"{php echo $this->createWebUrl('manage/goodsedit')}", url:"{php echo $this->createWebUrl('manage/goodsedit')}",
...@@ -329,8 +329,7 @@ ...@@ -329,8 +329,7 @@
</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 add"> <div class="layui-input-inline add" id="timeList">
<input type="text" value="" class="layui-input" name="start_time" id="StartTime" placeholder="年-月-日" >
</div> </div>
<div style="clear: both;padding-top: 15px;"><button class="layui-btn" onclick="dayHtml();return false;">+添加</button></div> <div style="clear: both;padding-top: 15px;"><button class="layui-btn" onclick="dayHtml();return false;">+添加</button></div>
...@@ -460,10 +459,10 @@ ...@@ -460,10 +459,10 @@
<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(){ function dayHtml(){
let count = $("input[name^='start_time']").size() + 1;
let names = "start_time"+count;
var html = ""; var html = "";
html+='<div class="layui-input-inline" style="width: 100px;">'; html+='<input type="date" name="'+names+'" class="layui-input" placeholder="年-月-日" />';
html+='<input type="text" name="start_time" Id="StartTime" class="layui-input" placeholder="年-月-日" />';
html+='</div>';
$(".add").append(html); $(".add").append(html);
} }
function getDatas(){ function getDatas(){
...@@ -523,6 +522,7 @@ ...@@ -523,6 +522,7 @@
$(function(){ $(function(){
getSheng(); getSheng();
timesFun(); timesFun();
dayHtml();
}) })
form.on('select(province)', function(data){ form.on('select(province)', function(data){
console.log(data.value); console.log(data.value);
...@@ -535,6 +535,7 @@ ...@@ -535,6 +535,7 @@
form.on('submit(formSub)', function(data){ form.on('submit(formSub)', function(data){
var formData = data.field; var formData = data.field;
var sta_time=getDatas(); var sta_time=getDatas();
delete formData.start_time;
var ids = ""; var ids = "";
var l = $("input[name='ids']").size(); var l = $("input[name='ids']").size();
for(var i=0;i<l;i++){ for(var i=0;i<l;i++){
...@@ -547,11 +548,22 @@ ...@@ -547,11 +548,22 @@
} }
} }
layer.load(); layer.load();debugger
if(formData.start_time){ let count = $("input[name^='start_time']").size();
var start_timeD = new Date(formData.start_time); let sites = [];
formData.start_time=start_timeD.getTime()/1000; for(let i = 1; i<= count; i++) {
let n = "start_time" + i
let t = {
time: formData[n]
};
sites.push(t);
delete formData[n];
} }
// if(formData.start_time){
// var start_timeD = new Date(formData.start_time);
// formData.start_time=start_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 = {
...@@ -562,6 +574,7 @@ ...@@ -562,6 +574,7 @@
if (id > 0) { if (id > 0) {
data.id = id; data.id = id;
} }
data.start_time=formData.start_time;
postData(url, data); postData(url, data);
return false; return false;
}); });
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
if (!first) { if (!first) {
//do something //do something
layer.load(); layer.load();
window.location.href = "{php echo $this->createWebUrl('manage/company')}" + "&page=" + obj.curr + "&keyword=" + keyword; window.location.href = "{php echo $this->createWebUrl('manage/make')}" + "&page=" + obj.curr + "&keyword=" + keyword;
// window.location.href = "{php echo $this->createWebUrl('cards')}" + "&page=" + obj.curr; // window.location.href = "{php echo $this->createWebUrl('cards')}" + "&page=" + obj.curr;
} }
} }
......
...@@ -9616,40 +9616,7 @@ class longbing_companyModuleWxapp extends WeModuleWxapp ...@@ -9616,40 +9616,7 @@ 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;
......
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