diff --git a/addons/dysms/config.php b/addons/dysms/config.php index a5f86d2..8473a0c 100755 --- a/addons/dysms/config.php +++ b/addons/dysms/config.php @@ -134,6 +134,12 @@ return array( 'value'=>'', 'tips'=>'' ), + 'PHONE_UNREGISTER'=>array( + 'title'=>'注销模板ID', + 'type'=>'text', + 'value'=>'', + 'tips'=>'' + ), // 'PHONE_PUSER_REGISTER_VERFIY'=>array( // 'title'=>'模板ID【模板参考:您好:您邀约会员注册,验证码:${code},如非本人或家人邀约,无公害请忽略。】', // 'type'=>'text', diff --git a/hyhproject/app/controller/Auth.php b/hyhproject/app/controller/Auth.php index 4165674..c4fef7d 100755 --- a/hyhproject/app/controller/Auth.php +++ b/hyhproject/app/controller/Auth.php @@ -59,7 +59,7 @@ class Auth extends Base{ } $fm = new FM(); if($fm->getInfo(['familyIdCard'=>$data['householdIdCard']],'id')){ - exit(jsonReturn('该身份证已报备,请更换')); + exit(jsonReturn('友情提示:您好:已有同身份证用户注册我商城,请联系您的家人查询“用户名”和相关密码。')); } } $isUpdate = 0; diff --git a/hyhproject/app/controller/Orders.php b/hyhproject/app/controller/Orders.php index 4e0b372..2b24687 100755 --- a/hyhproject/app/controller/Orders.php +++ b/hyhproject/app/controller/Orders.php @@ -315,7 +315,28 @@ class Orders extends Base{ return $rs; } - + public function shundaiList() + { + $page = input('page/d', 1); + $size = input('size/d', 10); + $lat = (float)input("lat",0); + $lng = (float)input("lng",0); + $m = new M(); + $status=[0]; + $rs = $m->alias('o')->join('__SHOPS__ s','o.shopId=s.shopId','left') + ->field('o.userAddress, o.userName, o.userPhone, o.deliverMoney, + o.goodsMoney as feeMoney,o.payTime as deliverBefore, + s.lng as shopLng, s.lat as shopLat, s.shopAddress, s.phone as shopPhone, + ROUND(12756.276*ASIN(SQRT(POW(SIN(('.$lat.'*0.0174532925-s.lat*0.0174532925)/2),2)+ + COS('.$lat.'*0.0174532925)*COS(s.lat*0.0174532925)*POW(SIN(('.$lng.'*0.0174532925-s.lng*0.0174532925)/2),2)))*1000) AS distance + ') + ->whereIn('o.orderStatus', $status) + ->where('o.deliverType', '=', 2) + ->order('distance', 'asc') + ->limit(($page-1)*$size, $size) + ->select(); + exit(jsonReturn('',1,$rs)); + } /*********************************************** 商家操作订单 ************************************************************/ diff --git a/hyhproject/app/controller/Qlgpay.php b/hyhproject/app/controller/Qlgpay.php index 1fd808f..dc8d35c 100755 --- a/hyhproject/app/controller/Qlgpay.php +++ b/hyhproject/app/controller/Qlgpay.php @@ -1,5 +1,6 @@ getUserId(); + $shopId = isset($rs['shopId'])?$rs['shopId']:0; $m = new OM(); $pay = array_merge($pay,$m->getPayMoney($userId,$pay['needPay'])); + $pay['shopId'] = $shopId; + $shopUserId = Db::name('shops')->where('shopId', '=', $shopId)->value('userId'); + if ($shopUserId) $pay['shopPaymentInfo'] = Db::name('user_recive') + ->where('userId', '=', $shopUserId) + ->find(); exit(jsonReturn('',1,$pay)); } diff --git a/hyhproject/app/controller/Users.php b/hyhproject/app/controller/Users.php index a247db8..d4797af 100755 --- a/hyhproject/app/controller/Users.php +++ b/hyhproject/app/controller/Users.php @@ -863,6 +863,26 @@ public function forgetPasss(){ return WSTReturn("成功", 1, $data); } } + + public function unregister_get_sms_code() { + $m = new MUsers(); + $data = $m->getById($this->getUserId()); + $userPhone = '15270565305'; +// $userPhone = $data['userPhone']; + $phoneVerify = rand(1000,9999); + $tpl = WSTMsgTemplates('PHONE_UNREGISTER'); + $rv = ['status'=>-1,'msg'=>'短信发送失败']; + if( $tpl['tplContent']!='' && $tpl['status']=='1'){ + $params = ['tpl'=>$tpl,'params'=>['code'=>$phoneVerify]]; + $m = new LogSms(); + $rv = $m->sendSMS(0,$userPhone,$params,'unregister_get_sms_code',$phoneVerify); + $rv['sms_code'] = $phoneVerify; + } + session('unreg.time', time()); + session('unreg.code', $phoneVerify); + exit(json_encode($rv)); + } + /** * 注销 */ @@ -872,10 +892,20 @@ public function forgetPasss(){ $user = $m->getById($userId); if (empty($user)) exit(jsonReturn('系统异常',0,[])); $opUser = input('post.op_user'); - $opContent = input('post.op_content'); - // TODO: 记录操作人员名称 - // TODO: 验证规则 + $opContent = input('post.op_content', ''); + $opPic = input('post.op_pic', ''); + + if (empty($opUser)) { + exit(jsonReturn('操作用户不能为空!',-1)); + } Db::startTrans(); + Db::name('user_unregister')->insert([ + 'historyData'=>json_encode($user), + 'historyUserName'=>$user['loginName'], + 'op_user'=>$opUser, + 'op_content'=>$opContent, + 'op_pic'=>$opPic, + ]); Db::name('user_lock')->insert([ 'lockTime'=>0, 'lockReason'=>'账号已注销,操作人:'.$opUser.',注销申请内容:'.$opContent, diff --git a/hyhproject/app/model/Carts.php b/hyhproject/app/model/Carts.php index 01c492d..c77b210 100755 --- a/hyhproject/app/model/Carts.php +++ b/hyhproject/app/model/Carts.php @@ -103,15 +103,8 @@ class Carts extends CCarts{ $tm = Model('common/Table'); $tm->setTable('shops'); //换算为3级循环等级 - if(0 == $rs['shopLevel']){ - $maxSaleMoney = dataConf('helpLevel0MaxSaleMoney'); - }else{ - //$nowLevel = $rs['shopLevel'] % 3; - $tm->setTable('users'); - //最大可销售金额 - $maxSaleMoney = $tm->getField(['userId'=>$rs['shopUserId']],'helpMaxSaleMoney'); - } - + //助微吧限销售额为≥?元 9900 。 提示:具体功能没实现,合并原“初始”、“一级”、“二级”、“三级”4项 @ 2020/09/19 + $maxSaleMoney = dataConf('helpLevel0MaxSaleMoney'); $tm->setTable('shops'); //当前销售值 $nowSaleMoney = $tm->getSum(['userId'=>$rs['shopUserId']],'helpSaleMoney'); diff --git a/hyhproject/common/common/function.php b/hyhproject/common/common/function.php index 45eda9b..ce4b9cf 100755 --- a/hyhproject/common/common/function.php +++ b/hyhproject/common/common/function.php @@ -376,7 +376,7 @@ function WSTCheckLoginKey($val,$userId = 0){ $dbo->where("userId", "<>", $userId); } if($dbo->find()){ - return WSTReturn("对不起,登录账号已存在"); + return WSTReturn("友情提示:您好:该用户名已注册"); } return WSTReturn("该登录账号可用",1); @@ -1337,6 +1337,7 @@ function WSTLangPayType($v){ */ function WSTLangDeliverType($v){ switch ($v) { + case 2:return "顺带件"; case 1:return "自提"; case 0:return "送货上门"; } diff --git a/hyhproject/common/model/OrderRefunds.php b/hyhproject/common/model/OrderRefunds.php index 794e1c7..96e6147 100755 --- a/hyhproject/common/model/OrderRefunds.php +++ b/hyhproject/common/model/OrderRefunds.php @@ -189,7 +189,10 @@ class OrderRefunds extends Base{ // } // // } - $object = $this->get($id); + $object = $this->where('orderId', $id)->find(); + if(!$object){ + return WSTReturn('未找到此订单(被删除无法找回的)'); + } $order = Db::name('orders')->where('orderId',$object->orderId)->field('userId,shopId,orderNo,orderId,useScore')->find(); if(!$order || $order['shopId'] != input('post.shopId')){ return WSTReturn('未找到此订单'); @@ -245,6 +248,7 @@ class OrderRefunds extends Base{ return WSTReturn('操作成功',1); } }catch (\Exception $e) { + throw $e; Db::rollback();errLog($e); } return WSTReturn('操作失败',-1); diff --git a/hyhproject/common/model/Orders.php b/hyhproject/common/model/Orders.php index 8937f5e..9acf7ef 100755 --- a/hyhproject/common/model/Orders.php +++ b/hyhproject/common/model/Orders.php @@ -1478,7 +1478,8 @@ class Orders extends Base{ //换算为3级循环等级 $nowLevel = $shopLevel % 3; //升级到下一级所需金额 - $upgradeMoney = dataConf('helpUpgradeLevel'.($nowLevel+1).'BuyMoney'); + // 助微吧再次销售限购物额为≥?元 @2020/09/19 + $upgradeMoney = dataConf('helpUpgradeLevel1BuyMoney'); //获取助微吧购物金额 $buyHelpMoney = $userInfo['buyHelpMoney'] + $order['realTotalMoney']; //查看是否够升级条件 @@ -3087,7 +3088,7 @@ class Orders extends Base{ }else{ $where['orderNo'] = $orderNo; } - $orders = model('orders')->where($where)->field('needPay,payRand')->select(); + $orders = model('orders')->where($where)->field('needPay,payRand,shopId')->select(); if(empty($orders))return []; $needPay = 0; $payRand = 0; @@ -3098,6 +3099,13 @@ class Orders extends Base{ $data = array(); $data["needPay"] = $needPay; $data["payRand"] = $payRand; + $shopId = $orders[0]['shopId']; + foreach ($orders as $_) { + if ($shopId != $_['shopId']) { + $shopId = -1; + } + } + if ($shopId>0) $data["shopId"] = $shopId; return $data; } diff --git a/hyhproject/common/model/Settlements.php b/hyhproject/common/model/Settlements.php index caf6643..3442abd 100755 --- a/hyhproject/common/model/Settlements.php +++ b/hyhproject/common/model/Settlements.php @@ -38,12 +38,15 @@ class Settlements extends Base // 5,获得预获产品券为被扣手续费的100% buyerPreProductInProductHandlingFeeScale // 6,获得预获产品券为被扣税费的100% buyerPreProductInProductTaxFeeScale - $buyerPreProductNum = round(($totalMoney + $order->deliverMoney)* (dataConf('buyerPreProductInProductScale')*0.01),2);//1 + // 购户获得预获产品券最高占产品额比例?% + $buyerPreProductNum = round(($totalMoney + $order->deliverMoney),2);//1 + $buyerMaxCouponsNum = round(($totalMoney + $order->deliverMoney)* (dataConf('buyerPreProductInProductScale')*0.01),2);//1 $buyerPreCoupousNum = round($discountMoney * (dataConf('buyerPreCoupousInSaleScale')*0.01),2);//2 // $buyerPreProductNum += round($order->productHandlingFee * (dataConf('buyerPreProductInHandlingFeeScale')*0.01),2);//3 // $buyerPreProductNum += round($order->productTaxFee * (dataConf('buyerPreProductInTaxFeeScale')*0.01),2);//4 // $buyerPreProductNum += round($order->couponsHandlingFee * (dataConf('buyerPreProductInProductHandlingFeeScale')*0.01),2);//5 // $buyerPreProductNum += round($order->couponsTaxFee * (dataConf('buyerPreProductInProductTaxFeeScale')*0.01),2);//6 + $buyerPreCoupousNum = $buyerPreCoupousNum > $buyerMaxCouponsNum ? $buyerMaxCouponsNum : $buyerPreCoupousNum; if($buyerPreProductNum >= 0.01 || $buyerPreCoupousNum>=0.01){ if(3 == $order->goodsType){ Model('common/UserVouchers')->insertVouchersNotice($order->userId,$orderId,$buyerPreProductNum,$buyerPreCoupousNum*((float)dataConf('helpSaleCouponsCalBase')/100),'交易订单【'.$order->orderNo.'】购户购物所得'); diff --git a/hyhproject/common/model/Users.php b/hyhproject/common/model/Users.php index 0717c83..33d65aa 100755 --- a/hyhproject/common/model/Users.php +++ b/hyhproject/common/model/Users.php @@ -337,7 +337,7 @@ class Users extends Base{ $fp = fopen("reg.lock", "r"); if(flock($fp,LOCK_EX | LOCK_NB)) {//if(flock($fp,LOCK_EX))阻塞(等待)模式 //检测账号是否存在 - $crs = WSTCheckLoginKey($loginName); + $crs = WSTCheckLoginKey($loginName); if($crs['status']!=1){ flock($fp,LOCK_UN); fclose($fp);