diff --git a/application/wap/controller/Article.php b/application/wap/controller/Article.php index 0f87472e..fba5738a 100644 --- a/application/wap/controller/Article.php +++ b/application/wap/controller/Article.php @@ -4,7 +4,6 @@ namespace app\wap\controller; use app\admin\model\article\Article as ArticleModel; use app\wap\model\wap\ArticleCategory; -use basic\WapBasic; use think\Db; /** @@ -37,8 +36,7 @@ class Article extends WapBasic { public function visit($id = '') { - $content = ArticleModel::where('status',1)->where('hide',0)->where('id',$id)->order('id desc')->find(); - + $content = ArticleModel::where('status',1)->where('hide',0)->where('id',$id)->find(); if(!$content || !$content["status"]) return $this->failed('此文章已经不存在!'); $content["content"] = Db::name('articleContent')->where('nid',$content["id"])->value('content'); //增加浏览次数 diff --git a/application/wap/controller/AuthApi.php b/application/wap/controller/AuthApi.php index aed986d5..a841d481 100644 --- a/application/wap/controller/AuthApi.php +++ b/application/wap/controller/AuthApi.php @@ -35,13 +35,12 @@ use app\wap\model\user\UserNotice; use app\wap\model\user\UserSign; use app\wap\model\user\WechatUser; use behavior\wap\StoreProductBehavior; -use service\WechatTemplateService; +use app\core\util\WechatTemplateService; use service\CacheService; use service\HookService; use service\JsonService; -use service\SystemConfigService; +use app\core\util\SystemConfigService; use service\UtilService; -use service\WechatService; use think\Cache; use think\Request; use think\Url; @@ -490,7 +489,11 @@ class AuthApi extends AuthController } $model = StoreProduct::validWhere(); if($cId && $sId){ - $model->where('cate_id',$sId); + $product_ids=\think\Db::name('store_product_cate')->where('cate_id',$sId)->column('product_id'); + if(count($product_ids)) + $model=$model->where('id',"in",$product_ids); + else + $model=$model->where('cate_id',-1); }elseif($cId){ $sids = StoreCategory::pidBySidList($cId)?:[]; $sids[] = $cId; diff --git a/application/wap/controller/AuthController.php b/application/wap/controller/AuthController.php index b6b41b5b..53ba0c8c 100644 --- a/application/wap/controller/AuthController.php +++ b/application/wap/controller/AuthController.php @@ -11,7 +11,6 @@ namespace app\wap\controller; use app\wap\model\store\StoreOrder; use app\wap\model\user\User; use app\wap\model\user\WechatUser; -use basic\WapBasic; use service\UtilService; use think\Cookie; use think\Session; diff --git a/application/wap/controller/Index.php b/application/wap/controller/Index.php index af02eae6..4f776f8a 100644 --- a/application/wap/controller/Index.php +++ b/application/wap/controller/Index.php @@ -17,10 +17,9 @@ use app\wap\model\user\User; use app\wap\model\user\UserNotice; use app\wap\model\user\WechatUser; use basic\WapBasic; -use service\GroupDataService; -use service\QrcodeService; -use service\SystemConfigService; -use service\WechatService; +use app\core\util\GroupDataService; +use app\core\util\QrcodeService; +use app\core\util\SystemConfigService; use think\Db; use think\Url; diff --git a/application/wap/controller/Login.php b/application/wap/controller/Login.php index 0af7b741..cf0ca319 100644 --- a/application/wap/controller/Login.php +++ b/application/wap/controller/Login.php @@ -10,9 +10,7 @@ namespace app\wap\controller; use app\wap\model\user\User; use app\wap\model\user\WechatUser; -use basic\WapBasic; use service\UtilService; -use service\WechatService; use think\Cookie; use think\Request; use think\Session; @@ -23,7 +21,7 @@ class Login extends WapBasic public function index($ref = '') { Cookie::set('is_bg',1); - $ref && $ref=htmlspecialchars(base64_decode($ref)); + $ref && $ref=htmlspecialchars_decode(base64_decode($ref)); if(UtilService::isWechatBrowser()){ $this->_logout(); $openid = $this->oauth(); diff --git a/application/wap/controller/My.php b/application/wap/controller/My.php index 67573d3e..b2721b35 100644 --- a/application/wap/controller/My.php +++ b/application/wap/controller/My.php @@ -24,11 +24,11 @@ use app\wap\model\user\User; use app\wap\model\user\UserBill; use app\wap\model\user\UserExtract; use app\wap\model\user\UserNotice; -use service\GroupDataService; +use app\core\util\GroupDataService; use app\wap\model\user\UserAddress; use app\wap\model\user\UserSign; use service\CacheService; -use service\SystemConfigService; +use app\core\util\SystemConfigService; use think\Request; use think\Url; diff --git a/application/wap/controller/PublicApi.php b/application/wap/controller/PublicApi.php index e780cf80..c849ab0b 100644 --- a/application/wap/controller/PublicApi.php +++ b/application/wap/controller/PublicApi.php @@ -15,6 +15,7 @@ use app\wap\model\store\StoreCategory; use app\wap\model\store\StoreCouponIssue; use app\wap\model\store\StoreProduct; use app\wap\model\wap\ArticleCategory; +use service\FileService; use service\JsonService; use service\UtilService; use think\Cache; @@ -103,8 +104,9 @@ class PublicApi { if(!$mediaIds) return JsonService::fail('参数错误'); $mediaIds = explode(',',$mediaIds); - $temporary = \service\WechatService::materialTemporaryService(); + $temporary = \app\core\util\WechatService::materialTemporaryService(); $pathList = []; + $dir='public'.DS.'uploads'.DS.'wechat'.DS.'media'; foreach ($mediaIds as $mediaId){ if(!$mediaId) continue; try{ @@ -113,7 +115,10 @@ class PublicApi continue; } $name = substr(md5($mediaId),12,20).'.jpg'; - $path = '.'.DS.'public'.DS.'uploads'.DS.'wechat'.DS.'media'.DS.$name; + $path = '.'.DS.$dir.DS.$name; + $file=new FileService(); + $res=$file->create_dir($dir); + if(!$res) return JsonService::fail('生成文件保存目录失败!请检查权限!'); $res = file_put_contents($path,$content); if($res) $pathList[] = UtilService::pathToUrl($path); } diff --git a/application/wap/controller/Service.php b/application/wap/controller/Service.php index 51312ec8..84d14245 100644 --- a/application/wap/controller/Service.php +++ b/application/wap/controller/Service.php @@ -8,7 +8,6 @@ namespace app\wap\controller; use app\wap\model\store\StoreService; -use service\SystemConfigService; use app\wap\model\user\User; use app\admin\model\system\Merchant; use think\Request; diff --git a/application/wap/controller/Store.php b/application/wap/controller/Store.php index e2d5e8d8..39c7aa6e 100644 --- a/application/wap/controller/Store.php +++ b/application/wap/controller/Store.php @@ -28,8 +28,8 @@ use app\wap\model\store\StoreProductRelation; use app\wap\model\user\User; use app\wap\model\user\WechatUser; use app\wap\model\store\StoreCombination; -use service\GroupDataService; -use service\SystemConfigService; +use app\core\util\GroupDataService; +use app\core\util\SystemConfigService; use service\UtilService; use think\Cache; use think\Request; diff --git a/application/wap/controller/WapBasic.php b/application/wap/controller/WapBasic.php index 6365ef14..6253018e 100644 --- a/application/wap/controller/WapBasic.php +++ b/application/wap/controller/WapBasic.php @@ -16,7 +16,7 @@ use think\Controller; use behavior\wechat\UserBehavior; use service\HookService; use service\UtilService; -use service\WechatService; +use app\core\util\WechatService; use think\Cookie; use think\Request; use think\Session; diff --git a/application/wap/controller/Wechat.php b/application/wap/controller/Wechat.php index e802cce8..834d970f 100755 --- a/application/wap/controller/Wechat.php +++ b/application/wap/controller/Wechat.php @@ -2,7 +2,7 @@ namespace app\wap\controller; use app\admin\model\wechat\WechatReply; -use service\WechatService; +use app\core\util\WechatService; /** @@ -32,7 +32,7 @@ class Wechat public function text() { - dump(WechatService::userGroupService()); + //dump(WechatService::userGroupService()); } diff --git a/application/wap/model/store/StoreOrder.php b/application/wap/model/store/StoreOrder.php index 654f1686..8442be4f 100644 --- a/application/wap/model/store/StoreOrder.php +++ b/application/wap/model/store/StoreOrder.php @@ -21,10 +21,10 @@ use behavior\wap\StoreProductBehavior; use behavior\wechat\PaymentBehavior; use service\HookService; use service\JsonService; -use service\SystemConfigService; +use app\core\util\SystemConfigService; use service\UtilService; -use service\WechatService; -use service\WechatTemplateService; +use app\core\util\WechatService; +use app\core\util\WechatTemplateService; use think\Cache; use think\Db; use think\Request; diff --git a/application/wap/model/user/User.php b/application/wap/model/user/User.php index 0fa8a212..b10a0b9c 100644 --- a/application/wap/model/user/User.php +++ b/application/wap/model/user/User.php @@ -9,7 +9,7 @@ namespace app\wap\model\user; use basic\ModelBasic; -use service\SystemConfigService; +use app\core\util\SystemConfigService; use think\Request; use think\response\Redirect; use think\Session; @@ -109,6 +109,7 @@ class User extends ModelBasic if($cost > $orderInfo['pay_price']) return true;//成本价大于支付价格时直接返回 $brokeragePrice = bcmul(bcsub($orderInfo['pay_price'],$cost,2),$brokerageRatio,2); //返佣之后余额 + $orderInfo['pay_price'] = bcsub($orderInfo['pay_price'],$orderInfo['pay_postage'],2); $balance = bcsub($userInfo['now_money'],$brokeragePrice,2); if($brokeragePrice <= 0) return true; $mark = $userInfo['nickname'].'成功消费'.floatval($orderInfo['pay_price']).'元,奖励推广佣金'.floatval($brokeragePrice); diff --git a/application/wap/model/user/UserExtract.php b/application/wap/model/user/UserExtract.php index 1a4926e8..44f49c27 100644 --- a/application/wap/model/user/UserExtract.php +++ b/application/wap/model/user/UserExtract.php @@ -9,8 +9,8 @@ namespace app\wap\model\user; use basic\ModelBasic; -use service\SystemConfigService; -use service\WechatTemplateService; +use app\core\util\SystemConfigService; +use app\core\util\WechatTemplateService; use think\Url; use traits\ModelTrait; diff --git a/application/wap/model/user/UserRecharge.php b/application/wap/model/user/UserRecharge.php index 0aa8feba..692ad83a 100644 --- a/application/wap/model/user/UserRecharge.php +++ b/application/wap/model/user/UserRecharge.php @@ -9,7 +9,7 @@ namespace app\wap\model\user; use app\wap\model\user\WechatUser; use basic\ModelBasic; -use service\WechatService; +use app\core\util\WechatService; use traits\ModelTrait; class UserRecharge extends ModelBasic diff --git a/application/wap/model/user/UserSign.php b/application/wap/model/user/UserSign.php index 68b208b7..9dbe0822 100644 --- a/application/wap/model/user/UserSign.php +++ b/application/wap/model/user/UserSign.php @@ -9,7 +9,7 @@ namespace app\wap\model\user; use basic\ModelBasic; -use service\SystemConfigService; +use app\core\util\SystemConfigService; use think\Model; class UserSign diff --git a/application/wap/model/user/WechatUser.php b/application/wap/model/user/WechatUser.php index 703cdd48..6563e2b1 100644 --- a/application/wap/model/user/WechatUser.php +++ b/application/wap/model/user/WechatUser.php @@ -10,9 +10,9 @@ namespace app\wap\model\user; use app\wap\model\store\StoreCoupon; use app\wap\model\store\StoreCouponUser; use basic\ModelBasic; -use service\SystemConfigService; +use app\core\util\SystemConfigService; use service\UtilService; -use service\WechatService; +use app\core\util\WechatService; use service\CacheService as Cache; use think\Session; use traits\ModelTrait; diff --git a/application/wap/view/first/index/about.html b/application/wap/view/first/index/about.html index 4f77535e..7dc1b96f 100644 --- a/application/wap/view/first/index/about.html +++ b/application/wap/view/first/index/about.html @@ -3,8 +3,8 @@ {block name="content"}
-
-

+
+

众邦科技提供技术支持

diff --git a/application/wap/view/first/index/index.html b/application/wap/view/first/index/index.html index 8d3a509b..8ee9a1d7 100644 --- a/application/wap/view/first/index/index.html +++ b/application/wap/view/first/index/index.html @@ -9,7 +9,7 @@ {/block} {block name="title"} - + {/block} {block name="content"}
@@ -454,10 +454,10 @@ var that = this; this.elInit(); this.getIssueCouponList(); - this.getproductList('is_best');//精品 - this.getproductList('is_hot');//热卖 - this.getproductList('is_benefit');//促销 - this.getproductList('is_new');//首发新品 +// this.getproductList('is_best');//精品 +// this.getproductList('is_hot');//热卖 +// this.getproductList('is_benefit');//促销 +// this.getproductList('is_new');//首发新品 this.getIssueCouponList(); this.getCateData(); this.getCombinationList();//猜猜喜欢 diff --git a/application/wap/view/first/index/spread.html b/application/wap/view/first/index/spread.html index 8def42cf..e2ec75bb 100644 --- a/application/wap/view/first/index/spread.html +++ b/application/wap/view/first/index/spread.html @@ -11,7 +11,7 @@
- 搜索微信公众号
+ 搜索微信公众号
或长按上方二维码立即关注
@@ -22,9 +22,9 @@