Bläddra i källkod

修复公众号bug,调整公众号引用类

liaofei 6 år sedan
förälder
incheckning
502e4c8a33

+ 1 - 3
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');
         //增加浏览次数

+ 7 - 4
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;

+ 0 - 1
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;

+ 3 - 4
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;
 

+ 1 - 3
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();

+ 2 - 2
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;
 

+ 7 - 2
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);
         }

+ 0 - 1
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;

+ 2 - 2
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;

+ 1 - 1
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;

+ 2 - 2
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());
     }
 
 

+ 3 - 3
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;

+ 2 - 1
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);

+ 2 - 2
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;
 

+ 1 - 1
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

+ 1 - 1
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

+ 2 - 2
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;

+ 2 - 2
application/wap/view/first/index/about.html

@@ -3,8 +3,8 @@
 {block name="content"}
     <div class="about-us">
         <section>
-            <div class="ewm"><img src="<?= \service\SystemConfigService::get('about_us') ?>" alt=""></div>
-            <p class="name"><?= \service\SystemConfigService::get('site_name') ?></p>
+            <div class="ewm"><img src="<?= \app\core\util\SystemConfigService::get('about_us') ?>" alt=""></div>
+            <p class="name"><?= \app\core\util\SystemConfigService::get('site_name') ?></p>
         </section>
         <div class="copy-right">
             <p>众邦科技提供技术支持</p>

+ 5 - 5
application/wap/view/first/index/index.html

@@ -9,7 +9,7 @@
 <script type="text/javascript" src="{__WAP_PATH}crmeb/js/lottie.min.js"></script>
 {/block}
 {block name="title"}
-<?= \service\SystemConfigService::get('site_name') ?>
+<?= \app\core\util\SystemConfigService::get('site_name') ?>
 {/block}
 {block name="content"}
 <div class="page-index" id="app-index">
@@ -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();//猜猜喜欢

+ 4 - 4
application/wap/view/first/index/spread.html

@@ -11,7 +11,7 @@
                 <img src="{$wechatUser.headimgurl}" style="width: 1rem;height: 1rem;position: absolute;left: 50%;top: 50%;margin-left: -.5rem;margin-top: -.5rem;" />
             </div>
             <div class="text-content">
-                搜索微信公众号 <span><?=\service\SystemConfigService::get('site_name')?></span><br />
+                搜索微信公众号 <span><?=\app\core\util\SystemConfigService::get('site_name')?></span><br />
                 或长按上方二维码立即关注
             </div>
             <div class="link"><a href="{:Url('Index/index')}">进入商城</a></div>
@@ -22,9 +22,9 @@
 <script>
     mapleWx($jssdk(),function(){
        this.onMenuShareAll({
-           title:'<?=\service\SystemConfigService::get('wechat_share_title')?>',
-           imgUrl:location.origin+'<?=\service\SystemConfigService::get('wechat_share_img')?>',
-           desc:'<?=\service\SystemConfigService::get('wechat_share_synopsis')?>',
+           title:'<?=\app\core\util\SystemConfigService::get('wechat_share_title')?>',
+           imgUrl:location.origin+'<?=\app\core\util\SystemConfigService::get('wechat_share_img')?>',
+           desc:'<?=\app\core\util\SystemConfigService::get('wechat_share_synopsis')?>',
            link:"{:Url('Index/index',['spuid'=>$wechatUser['uid']],true,true)}"
        });
     });

+ 19 - 12
application/wap/view/first/my/index.html

@@ -46,6 +46,13 @@
                     <img src="{__WAP_PATH}crmeb/images/user-orders-list001.png" />
                     <p>待付款</p>
                 </a>
+                 <a href="{$orderListUrl}#11">
+                      {gt name="orderStatusNum.noPink" value="0"}
+                      <i class="mark_num">{$orderStatusNum.noPink > 99 ? 99 : $orderStatusNum.noPink}</i>
+                      {/gt}
+                      <img src="{__WAP_PATH}crmeb/images/user-orders-list005.png" />
+                      <p>团购中</p>
+                  </a>
                 <a href="{$orderListUrl}#1">
                     {gt name="orderStatusNum.noPostage" value="0"}
                     <i class="mark_num">{$orderStatusNum.noPostage > 99 ? 99 : $orderStatusNum.noPostage}</i>
@@ -79,18 +86,18 @@
             </div>
             {/volist}
             {if condition="$statu == 2 || $userInfo['is_promoter'] == 1"}
-            <div class="item">
-                <a class="con-cell" href="/wap/my/spread_list.html">
-                    <img src="/public/uploads/common/5abc5804670d2.png" alt="">
-                    <p>我的推广人</p>
-                </a>
-            </div>
-            <div class="item">
-                <a class="con-cell" href="/wap/index/spread.html">
-                    <img src="/public/uploads/common/5abc5816d752b.png" alt="">
-                    <p>推广二维码</p>
-                </a>
-            </div>
+                <div class="item">
+                    <a class="con-cell" href="/wap/my/spread_list.html">
+                        <img src="/public/uploads/common/5abc5804670d2.png" alt="">
+                        <p>我的推广人</p>
+                    </a>
+                </div>
+                <div class="item">
+                    <a class="con-cell" href="/wap/index/spread.html">
+                        <img src="/public/uploads/common/5abc5816d752b.png" alt="">
+                        <p>推广二维码</p>
+                    </a>
+                </div>
             {/if}
         </div>
     </section>

+ 3 - 2
application/wap/view/first/my/order_list.html

@@ -12,8 +12,9 @@
                 <button type="button" @click="searchOrder"><i class="iconfont icon-icon"></i></button>
             </div>
             <div class="menu flex" ref="nav">
-                <div class="item" :class="{on:type === ''}" @click="changeType('')"><span>全部</span></div>
+                <div class="item" :class="{on:type === 'all'}" @click="changeType('all')"><span>全部</span></div>
                 <div class="item" :class="{on:type === 0}" @click="changeType(0)"><span>待付款</span></div>
+                <div class="item" :class="{on:type == 11}" @click="changeType(11)"><span>拼团中</span></div>
                 <div class="item" :class="{on:type == 1}" @click="changeType(1)"><span>待发货</span></div>
                 <div class="item" :class="{on:type == 2}" @click="changeType(2)"><span>待收货</span></div>
                 <div class="item" :class="{on:type == 3}" @click="changeType(3)"><span>待评价</span></div>
@@ -205,7 +206,7 @@
                         if(group.loaded) return ;
                         this.loading = true;
                         storeApi.getUserOrderList({
-                            type:this.type,
+                            type:this.type=='all' ?'null':this.type,
                             first:group.first,
                             limit:group.limit,
                             search:this.search

+ 4 - 4
application/wap/view/first/public/container.html

@@ -7,10 +7,10 @@
     {block name="head_top"}{/block}
     <script type="text/javascript" src="{__PLUG_PATH}wxApi.js"></script>
     <script>
-        $jssdk = function(){return <?=\service\WechatService::jsSdk()?>;}
-        window.wechat_share_title="<?=\service\SystemConfigService::get('wechat_share_title')?>";
-        window.wechat_share_synopsis="<?=\service\SystemConfigService::get('wechat_share_synopsis')?>";
-        window.wechat_share_img="<?=\service\SystemConfigService::get('wechat_share_img')?>";
+        $jssdk = function(){return <?=\app\core\util\WechatService::jsSdk()?>;}
+        window.wechat_share_title="<?=\app\core\util\SystemConfigService::get('wechat_share_title')?>";
+        window.wechat_share_synopsis="<?=\app\core\util\SystemConfigService::get('wechat_share_synopsis')?>";
+        window.wechat_share_img="<?=\app\core\util\SystemConfigService::get('wechat_share_img')?>";
         mapleWx($jssdk(), function () {
             this.onMenuShareAll({
                 title: wechat_share_title || $('title').text(),

+ 4 - 4
application/wap/view/first/public/requirejs.html

@@ -1,10 +1,10 @@
 <script type="text/javascript" src="{__PLUG_PATH}requirejs/require.js"></script>
 <script>
     requirejs.config({
-        urlArgs: "v=201712230955",
+        urlArgs: "v=15615616515616556",
         map: {
             '*': {
-                'css': "{__PLUG_PATH}requirejs/require-css.js"
+                'css': '{__PUBLIC_PATH}static/plug/requirejs/require-css.js'
             }
         },
         shim: {
@@ -24,7 +24,7 @@
                 deps: ['css!yduicss']
             }
         },
-        baseUrl: '//' + location.hostname + "{__PUBLIC_PATH}",
+        baseUrl: '//' + location.hostname + '{__PUBLIC_PATH}',
         paths: {
             'static': 'static',
             'vue': 'static/plug/vue/dist/vue.min',
@@ -38,7 +38,7 @@
             'moment': 'static/plug/moment',
             'sweetalert': 'static/plug/sweetalert2/sweetalert2.all.min',
             'helper':'static/plug/helper',
-            'store':'wap/first/crmeb/module/store',
+            'store':'{__WAP_PATH}crmeb/module/store',
             'better-scroll':"static/plug/better-scroll",
             'ydui':"static/plug/ydui/ydui",
             'yduicss':"static/plug/ydui/ydui-px",