From 02bee9f9129689bc4829a7304e2889ece7818c30 Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Sun, 9 Dec 2018 23:17:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B8=85=E9=99=A4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8A=A5=E9=94=99=EF=BC=8C=E5=90=8E=E5=8F=B0=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E7=BB=9F=E8=AE=A1=E9=BB=98=E8=AE=A4=E7=A9=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8A=A5=E9=94=99=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=B4=AD=E7=89=A9=E8=BD=A6=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Index.php | 2 +- application/admin/controller/system/SystemCleardata.php | 4 ++-- extend/behavior/wechat/UserBehavior.php | 7 ++++++- view/crmebN/pages/buycar/buycar.wxml | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index 3a78c6b6..6a6835c5 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -160,7 +160,7 @@ class Index extends AuthController ->group("FROM_UNIXTIME(add_time, '%Y%m%e')") ->order('add_time asc') ->select()->toArray(); - if(empty($order_list)) return false; + if(empty($order_list)) return Json::fail('无数据'); foreach ($order_list as $k=>&$v){ $order_list[$v['day']] = $v; } diff --git a/application/admin/controller/system/SystemCleardata.php b/application/admin/controller/system/SystemCleardata.php index 6da840f1..98208360 100644 --- a/application/admin/controller/system/SystemCleardata.php +++ b/application/admin/controller/system/SystemCleardata.php @@ -87,7 +87,7 @@ class SystemCleardata extends AuthController } //修改用户默认密码 public function userdate(){ - SystemCleardata::ClearData('user',1); +// SystemCleardata::ClearData('user',1); $headimgurl= WechatUser::Where('uid',1)->value('headimgurl'); $data['account']='crmeb'; $data['pwd']=md5(123456); @@ -141,7 +141,7 @@ class SystemCleardata extends AuthController } //递归删除文件 function delDirAndFile($dirName,$subdir=true){ - if ($handle = opendir("$dirName")){ + if ($handle = @opendir("$dirName")){ while(false !== ($item = readdir($handle))){ if($item != "." && $item != ".."){ if(is_dir("$dirName/$item")) diff --git a/extend/behavior/wechat/UserBehavior.php b/extend/behavior/wechat/UserBehavior.php index 7b777271..5f7481d1 100644 --- a/extend/behavior/wechat/UserBehavior.php +++ b/extend/behavior/wechat/UserBehavior.php @@ -24,7 +24,12 @@ class UserBehavior if(isset($wechatInfo['unionid']) && $wechatInfo['unionid'] != '' && WechatUser::be(['unionid'=>$wechatInfo['unionid']])){ WechatUser::edit($wechatInfo,$wechatInfo['unionid'],'unionid'); $uid = WechatUser::where('unionid',$wechatInfo['unionid'])->value('uid'); - User::updateWechatUser($wechatInfo,$uid); + if(!User::be(['uid'=>$uid])){ + $wechatInfo = WechatUser::where('uid',$uid)->find(); + User::setWechatUser($wechatInfo); + }else{ + User::updateWechatUser($wechatInfo,$uid); + } }else if(WechatUser::be(['openid'=>$wechatInfo['openid']])){ WechatUser::edit($wechatInfo,$wechatInfo['openid'],'openid'); User::updateWechatUser($wechatInfo,WechatUser::openidToUid($wechatInfo['openid'])); diff --git a/view/crmebN/pages/buycar/buycar.wxml b/view/crmebN/pages/buycar/buycar.wxml index 7b4a4cfb..3aa125ba 100644 --- a/view/crmebN/pages/buycar/buycar.wxml +++ b/view/crmebN/pages/buycar/buycar.wxml @@ -1,7 +1,8 @@
购物数量({{cartNum}}) - 管理 + 管理 + 取消