From 5ee3a01cf862a55b39e899c20e0af75503c96d22 Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Thu, 25 Oct 2018 15:03:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=AE=A2=E5=8D=95=E6=95=B0=E9=87=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Index.php | 23 +- application/routine/view/crmebN/app.json | 1 - .../view/crmebN/pages/cut-one/cut-one.js | 465 ------------------ .../view/crmebN/pages/cut-one/cut-one.json | 3 - .../view/crmebN/pages/cut-one/cut-one.wxml | 134 ----- .../view/crmebN/pages/cut-one/cut-one.wxss | 76 --- 6 files changed, 10 insertions(+), 692 deletions(-) delete mode 100644 application/routine/view/crmebN/pages/cut-one/cut-one.js delete mode 100644 application/routine/view/crmebN/pages/cut-one/cut-one.json delete mode 100644 application/routine/view/crmebN/pages/cut-one/cut-one.wxml delete mode 100644 application/routine/view/crmebN/pages/cut-one/cut-one.wxss diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index 1afe3907..3a78c6b6 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -46,27 +46,22 @@ class Index extends AuthController $now_day = strtotime(date('Y-m-d'));//今日 $pre_day = strtotime(date('Y-m-d',strtotime('-1 day')));//昨天时间戳 $beforyester_day = strtotime(date('Y-m-d',strtotime('-2 day')));//前天时间戳 - //昨天待发货数量 - $topData['orderDeliveryNum'] = StoreOrderModel::isMainYesterdayCount($pre_day,$now_day) - ->where('status',0) + //待发货数量 + $topData['orderDeliveryNum'] = StoreOrderModel::where('status',0) ->where('paid',1) ->where('refund_status',0) ->count(); - //昨天退换货订单数 - $topData['orderRefundNum'] = StoreOrderModel::isMainYesterdayCount($pre_day,$now_day) - ->where('paid',1) - ->where('refund_status','IN','1,2') + //退换货订单数 + $topData['orderRefundNum'] = StoreOrderModel::where('paid',1) + ->where('refund_status','IN','1') ->count(); //库存预警 $replenishment_num = SystemConfig::getValue('store_stock') > 0 ? SystemConfig::getValue('store_stock') : 20;//库存预警界限 $topData['stockProduct'] = StoreProduct::where('stock','<=',$replenishment_num)->where('is_del',0)->count(); //待处理提现 $topData['treatedExtract'] = UserExtractModel::where('status',0)->count(); - //昨日订单数 - $topData['orderNum'] = StoreOrderModel::isMainYesterdayCount($pre_day,$now_day)->count(); -// //昨日交易额 -// $orderPriceNum = StoreOrderModel::isMainYesterdayCount($pre_day,$now_day)->field('sum(pay_price) as pay_price')->find()['pay_price']; -// $topData['orderPriceNum'] = $orderPriceNum ? $orderPriceNum : 0; + + //订单数->日 $now_day_order_p = StoreOrderModel::where('paid',1)->where('pay_time','gt',$now_day)->count(); $pre_day_order_p = StoreOrderModel::where('paid',1)->where('pay_time','gt',$pre_day)->where('pay_time','lt',$now_day)->count(); @@ -537,6 +532,7 @@ class Index extends AuthController */ public function userchart(){ header('Content-type:text/json'); + $starday = date('Y-m-d',strtotime('-30 day')); $yesterday = date('Y-m-d'); @@ -549,7 +545,7 @@ class Index extends AuthController $data = []; $chartdata['legend'] = ['用户数'];//分类 $chartdata['yAxis']['maxnum'] = 0;//最大值数量 - if(empty($user_list)) return Json::fail('没有数据'); + if(empty($user_list))return Json::fail('无数据'); foreach ($user_list as $k=>$v){ $data['day'][] = $v['day']; $data['count'][] = $v['count']; @@ -558,6 +554,7 @@ class Index extends AuthController } $chartdata['xAxis'] = $data['day'];//X轴值 $chartdata['series'] = $data['count'];//分类1值 + return Json::succ('ok',$chartdata); } diff --git a/application/routine/view/crmebN/app.json b/application/routine/view/crmebN/app.json index c8bcc378..629c1dc2 100644 --- a/application/routine/view/crmebN/app.json +++ b/application/routine/view/crmebN/app.json @@ -26,7 +26,6 @@ "pages/foo-tan/foo-tan", "pages/buycar/buycar", "pages/mycut/mycut", - "pages/join-pink/index", "pages/user/user", "pages/integral-con/integral-con", "pages/orders-con/orders-con", diff --git a/application/routine/view/crmebN/pages/cut-one/cut-one.js b/application/routine/view/crmebN/pages/cut-one/cut-one.js deleted file mode 100644 index 4d483f19..00000000 --- a/application/routine/view/crmebN/pages/cut-one/cut-one.js +++ /dev/null @@ -1,465 +0,0 @@ -// pages/cut-one/cut-one.js -var app = getApp(); -var wxh = require('../../utils/wxh.js'); -var WxParse = require('../../wxParse/wxParse.js'); -Page({ - - /** - * 页面的初始数据 - */ - data: { - uid: app.globalData.uid,//登录人uid - bargainUid:0,//参与砍价uid - bargainUserInfo:[],//参与人信息 - bargainId:0,//砍价产品ID - status:0,// 0未参与砍价 1参与砍价 2 帮别人砍价 3 已帮别人砍价 4 砍价结束 - count:[],//顶部人数 - bargainUserHelp:[],//砍价帮人 - HelpCount:0,//砍价帮总人数 - HelpPrice:0,//剩余多少金额 - pricePercent:0,//进度条 - bargainUserHelpUserInfo:[], - url: app.globalData.urlImages, - hiddens: true, - hiddens2:true, - product:[], - countDownDay:'00', - countDownHour:'00', - countDownMinute:'00', - countDownSecond:'00', - }, - onLoad: function (options) { - app.setBarColor(); - app.globalData.openPages = '/pages/cut-one/cut-one?bargainUid=' + options.bargainUid + '&id=' + options.id; - app.setUserInfo(); - if (options.id && options.bargainUid) { - this.setData({ - bargainId: options.id, - bargainUid: options.bargainUid - }) - this.getbargain(); - this.getBargainCount(); - this.addLookBargain(); - } else if (options.id){ - this.setData({ - bargainId: options.id, - bargainUid: app.globalData.uid - }) - this.getbargain(); - this.getBargainCount(); - this.addLookBargain(); - }else { - wx.showToast({ - title: '参数错误', - icon: 'none', - duration: 1000 - }) - setTimeout(function () { - wx.navigateTo({ - url: '/pages/cut-list/cut-list' - }) - }, 1200) - } - },//获取砍价产品 - getbargain: function () { - var that = this; - wx.request({ - url: app.globalData.url + '/routine/auth_api/get_bargain?uid=' + app.globalData.uid, - data: { bargainId: that.data.bargainId }, - method: 'GET', - success: function (res) { - if (res.data.code == 200) { - that.setData({ - product: res.data.data - }) - that.dtime(); - if (that.data.bargainUid == app.globalData.uid) { - that.setData({ - status: 1 - }) - that.setBargain(); - } else { - that.setData({ - status: 2 - }) - that.getBargainUser(); - that.getUserInfo(); - that.getBargainHelpCount(); - } - if (that.data.product.description) WxParse.wxParse('description', 'html', that.data.product.description, that, 0); - if (that.data.product.rule) WxParse.wxParse('rule', 'html', that.data.product.rule, that, 0); - } else { - that.setData({ - product: [] - }) - } - } - }) - },//倒计时 - dtime: function () { - var that = this; - var timeStamp = that.data.product.stop_time; - wxh.time2(timeStamp, that); - },//获取顶部人数 - getBargainCount: function () { - var that = this; - wx.request({ - url: app.globalData.url + '/routine/auth_api/get_bargain_count?uid=' + app.globalData.uid, - method: 'GET', - success: function (res) { - if (res.data.code == 200) { - that.setData({ - count: res.data.data - }) - } else { - that.setData({ - count: [] - }) - } - } - }) - },//参与砍价 - setBargain: function () { - var that = this; - wx.request({ - url: app.globalData.url + '/routine/auth_api/set_bargain?uid=' + app.globalData.uid, - data: { bargainId: that.data.bargainId }, - method: 'GET', - success: function (res) { - if (res.data.code == 200) { - wx.showToast({ - title: res.data.msg, - icon: 'success', - duration: 2000 - }) - that.setData({ - status:1, - bargainUid: app.globalData.uid - }) - } else { - // wx.showToast({ - // title: res.data.msg, - // icon: 'none', - // duration: 2000 - // }) - } - that.setBargainHelp(); - that.isBargainUser(); - } - }) - },//参与砍价帮砍 - setBargainHelp: function () { - var that = this; - wx.request({ - url: app.globalData.url + '/routine/auth_api/set_bargain_help?uid=' + app.globalData.uid, - data: { - bargainId: that.data.bargainId, - bargainUserId: that.data.bargainUid - }, - method: 'GET', - success: function (res) { - if (res.data.code == 200){ - wx.showToast({ - title: res.data.msg, - icon: 'success', - duration: 2000 - }) - if (that.data.bargainUid != app.globalData.uid) { - that.setData({ - status: 3, - bargainUserHelpUserInfo: res.data.data, - hiddens2: false - }) - }else{ - that.setData({ - status: 1, - bargainUserHelpUserInfo: res.data.data, - hiddens2: false - }) - } - that.getBargainUser(); - that.getUserInfo(); - that.getBargainHelpCount(); - } else { - that.isBargainUserHelp(); - } - } - }) - },//判断当前用户是否可以砍价 - isBargainUserHelp:function(){ - var that = this; - wx.request({ - url: app.globalData.url + '/routine/auth_api/is_bargain_user_help?uid=' + app.globalData.uid, - data: { - bargainId: that.data.bargainId, - bargainUserId: that.data.bargainUid - }, - method: 'GET', - success: function (res) { - if (res.data.code == 200) { - wx.showToast({ - title: res.data.msg, - icon: 'none', - duration: 2000 - }) - } else { - if (that.data.bargainUid != app.globalData.uid) { - wx.showToast({ - title: '您不能在帮' + that.data.bargainUserInfo.nickname + '砍价了', - icon: 'none', - duration: 2000 - }) - that.setData({ - status: 3 - }) - } else { - that.setData({ - status: 1, - }) - } - } - } - }) - }, - //判断当前登录人是否参与砍价 - isBargainUser: function () { - var that = this; - wx.request({ - url: app.globalData.url + '/routine/auth_api/is_bargain_user?uid=' + app.globalData.uid, - data: { bargainId: that.data.bargainId }, - method: 'GET', - success: function (res) { - if (res.data.code == 200) { - that.setData({ - bargainUid: app.globalData.uid, - status: 1 - }) - that.getBargainUser(); - that.getUserInfo(); - that.getBargainHelpCount(); - } else { - that.setData({ - bargainUid: 0, - status:0 - }) - } - } - }) - },//获取砍价帮 - getBargainUser: function () { - var that = this; - wx.request({ - url: app.globalData.url + '/routine/auth_api/get_bargain_user?uid=' + app.globalData.uid, - data: { - bargainId: that.data.bargainId, - bargainUid: that.data.bargainUid - }, - method: 'GET', - success: function (res) { - if (res.data.code == 200) { - that.setData({ - bargainUserHelp: res.data.data - }) - } else { - that.setData({ - bargainUserHelp: [] - }) - } - } - }) - },//获取当前参与砍价人的信息 - getUserInfo:function(){ - var that = this; - wx.request({ - url: app.globalData.url + '/routine/auth_api/get_user_info_uid?uid=' + app.globalData.uid, - data: { - userId: that.data.bargainUid - }, - method: 'GET', - success: function (res) { - if (res.data.code == 200) { - that.setData({ - bargainUserInfo: res.data.data - }) - } else { - wx.showToast({ - title: res.data.msg, - icon: 'none', - duration: 2000 - }) - that.setData({ - bargainUserInfo: [] - }) - } - } - }) - },//获取砍价帮总人数 - getBargainHelpCount:function(){ - var that = this; - wx.request({ - url: app.globalData.url + '/routine/auth_api/get_bargain_help_count?uid=' + app.globalData.uid, - data: { - bargainId: that.data.bargainId, - bargainUserId: that.data.bargainUid - }, - method: 'GET', - success: function (res) { - if (res.data.code == 200) { - if (res.data.data.price <= 0 && app.globalData.uid == that.data.bargainUid){ - that.setData({ - status:4 - }) - } - that.setData({ - HelpCount: res.data.data.count, - HelpPrice: res.data.data.price, - pricePercent: res.data.data.pricePercent - }) - } else { - wx.showToast({ - title: res.data.msg, - icon: 'none', - duration: 2000 - }) - that.setData({ - HelpCount: 0, - HelpPrice:0, - pricePercent:0 - }) - } - } - }) - }, - getCutList:function(){ - wx.navigateTo({ - url: '/pages/cut-list/cut-list' - }) - },//砍价成功后支付订单 - goOrderPay:function(){ - var that = this; - if (that.data.bargainUid != app.globalData.uid){ - wx.showToast({ - title: '参数错误', - icon: 'none', - duration: 2000 - }) - }else{ - wx.request({ - url: app.globalData.url + '/routine/auth_api/now_buy?uid=' + app.globalData.uid, - method: 'GET', - data: { - productId: that.data.product.product_id, - cartNum: that.data.product.num, - bargainId: that.data.product.id, - }, - success: function (res) { - if (res.data.code == 200) { - wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候) - url: '/pages/order-confirm/order-confirm?id=' + res.data.data.cartId - }) - } else { - wx.showToast({ - title: res.data.msg, - icon: 'none', - duration: 2000 - }) - } - } - }) - } - }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - rules:function(e){ - this.setData({ - hiddens:false - }) - }, - butguan:function(e){ - this.setData({ - hiddens: true - }) - }, - butguan2:function(e){ - this.setData({ - hiddens2: true - }) - }, - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - addLookBargain: function () { - var that = this; - wx.request({ - url: app.globalData.url + '/routine/auth_api/add_look_bargain?uid=' + app.globalData.uid, - method: 'GET', - data: { - bargainId: that.data.bargainId, - }, - success: function (res) { - that.getBargainCount(); - } - }) - }, - addShareBargain:function(){ - var that = this; - wx.request({ - url: app.globalData.url + '/routine/auth_api/add_share_bargain?uid=' + app.globalData.uid, - method: 'GET', - data: { - bargainId: that.data.bargainId, - }, - success: function (res) { - that.getBargainCount(); - } - }) - }, - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - var that = this; - return { - title: that.data.bargainUserInfo.nickname+'邀请您帮砍价', - path: '/pages/cut-one/cut-one?bargainUid=' + that.data.bargainUid + '&id=' + that.data.bargainId, - imageUrl: that.data.url + that.data.product.image, - success:function(){ - that.addShareBargain(); - wx.showToast({ - title: '分享成功', - icon: 'success', - duration: 2000 - }) - } - } - } -}) \ No newline at end of file diff --git a/application/routine/view/crmebN/pages/cut-one/cut-one.json b/application/routine/view/crmebN/pages/cut-one/cut-one.json deleted file mode 100644 index eaaff174..00000000 --- a/application/routine/view/crmebN/pages/cut-one/cut-one.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "navigationBarTitleText": "砍价详情" -} \ No newline at end of file diff --git a/application/routine/view/crmebN/pages/cut-one/cut-one.wxml b/application/routine/view/crmebN/pages/cut-one/cut-one.wxml deleted file mode 100644 index 1ce0f5d4..00000000 --- a/application/routine/view/crmebN/pages/cut-one/cut-one.wxml +++ /dev/null @@ -1,134 +0,0 @@ - - - - {{count.lookCount}}人查看{{count.shareCount}}人分享{{count.userCount}}人参与 - - 活动 - 规则 - - 活动结束倒计时{{countDownHour}}{{countDownMinute}}{{countDownSecond}} - - - - - - {{product.title}} - - 最低¥{{product.min_price}} - 原价¥{{product.price}} - - - - - - - 已有{{HelpCount}}位好友成功帮您砍价 - 距离目标还有{{HelpPrice}}元 - - - - - 原价 - ¥{{product.price}} - - - 目标 - ¥{{product.min_price}} - - - - - {{bargainUserInfo.nickname}} 邀请您帮忙砍价 - 距离目标还有{{HelpPrice}}元 - - - - - 原价 - ¥{{product.price}} - - - 目标 - ¥{{product.min_price}} - - - 帮好友砍一刀 - - - 距离目标还有{{HelpPrice}}元 - - - - 原价 - ¥{{product.price}} - - - 目标 - ¥{{product.min_price}} - - - 已帮助好友砍价 - 我也要参与 - - 恭喜您成功砍到最低价,快去支付订单吧! - 立即支付订单 - 低价拿更多商品 - 活动已结束 - 低价拿更多商品 - - - - - - - 砍价帮 - - - - - - - - {{item.nickname}} - - - 砍掉{{item.price}}元 - - - - · 只显示最近15个好友砍价纪录 · - - - - 商品详情 - - -