From b8b33d51a92b562ca0766fa3a426e2a6206b7fee Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Thu, 17 Jan 2019 00:37:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89facade=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=EF=BC=8Cphp5.6=E5=85=BC=E5=AE=B9=E6=80=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Admin.php | 2 +- application/admin/controller/Answer.php | 2 +- application/admin/controller/Appconfig.php | 2 +- application/admin/controller/Apphomenav.php | 2 +- .../admin/controller/Appminialipayconfig.php | 2 +- .../admin/controller/Appminialipaylist.php | 2 +- .../admin/controller/Appminiweixinconfig.php | 2 +- .../admin/controller/Appminiweixinlist.php | 2 +- application/admin/controller/Article.php | 2 +- .../admin/controller/Articlecategory.php | 2 +- application/admin/controller/Brand.php | 2 +- .../admin/controller/Brandcategory.php | 2 +- application/admin/controller/Common.php | 4 +- application/admin/controller/Config.php | 2 +- application/admin/controller/Customview.php | 2 +- application/admin/controller/Email.php | 2 +- application/admin/controller/Express.php | 2 +- application/admin/controller/Goods.php | 8 +- .../admin/controller/Goodscategory.php | 2 +- application/admin/controller/Integrallog.php | 2 +- application/admin/controller/Link.php | 2 +- application/admin/controller/Message.php | 2 +- application/admin/controller/Navigation.php | 6 +- application/admin/controller/Order.php | 6 +- application/admin/controller/Paylog.php | 2 +- application/admin/controller/Payment.php | 4 +- application/admin/controller/Power.php | 2 +- application/admin/controller/Region.php | 2 +- .../admin/controller/Screeningprice.php | 2 +- application/admin/controller/Seo.php | 2 +- application/admin/controller/Site.php | 2 +- application/admin/controller/Slide.php | 2 +- application/admin/controller/Sms.php | 2 +- application/admin/controller/Theme.php | 4 +- application/admin/controller/User.php | 4 +- .../view/default/screeningprice/index.html | 2 +- application/api/config/app.php | 0 application/api/controller/Answer.php | 2 +- application/api/controller/Banner.php | 2 +- application/api/controller/Buy.php | 8 +- application/api/controller/Cart.php | 2 +- application/api/controller/Common.php | 4 +- application/api/controller/Goods.php | 2 +- application/api/controller/Index.php | 6 +- application/api/controller/Message.php | 2 +- application/api/controller/Navigation.php | 2 +- application/api/controller/Order.php | 4 +- application/api/controller/Ordernotify.php | 2 +- application/api/controller/Region.php | 2 +- application/api/controller/Search.php | 4 +- application/api/controller/User.php | 8 +- application/api/controller/Useraddress.php | 2 +- .../api/controller/Usergoodsbrowse.php | 2 +- application/api/controller/Usergoodsfavor.php | 2 +- application/api/controller/Userintegral.php | 2 +- application/facade/AdminPowerService.php | 38 ----- application/facade/AdminService.php | 38 ----- application/facade/AnswerService.php | 38 ----- application/facade/AppMiniService.php | 38 ----- application/facade/AppNavService.php | 38 ----- application/facade/ArticleService.php | 38 ----- application/facade/BannerService.php | 38 ----- application/facade/BrandService.php | 38 ----- application/facade/BuyService.php | 38 ----- application/facade/ConfigService.php | 38 ----- application/facade/CustomViewService.php | 38 ----- application/facade/ExpressService.php | 38 ----- application/facade/GoodsService.php | 38 ----- application/facade/IntegralService.php | 38 ----- application/facade/LinkService.php | 38 ----- application/facade/MessageService.php | 38 ----- application/facade/NavigationService.php | 38 ----- application/facade/OrderService.php | 38 ----- application/facade/PayLogService.php | 38 ----- application/facade/PaymentService.php | 38 ----- application/facade/RegionService.php | 38 ----- application/facade/ResourcesService.php | 38 ----- application/facade/SafetyService.php | 38 ----- application/facade/ScreeningPriceService.php | 38 ----- application/facade/SearchService.php | 38 ----- application/facade/SlideService.php | 38 ----- application/facade/ThemeService.php | 38 ----- application/facade/UserService.php | 38 ----- application/index/controller/Article.php | 2 +- application/index/controller/Buy.php | 8 +- application/index/controller/Cart.php | 2 +- application/index/controller/Common.php | 14 +- application/index/controller/Customview.php | 2 +- application/index/controller/Goods.php | 2 +- application/index/controller/Index.php | 8 +- application/index/controller/Message.php | 2 +- application/index/controller/Order.php | 4 +- application/index/controller/Personal.php | 2 +- application/index/controller/Region.php | 2 +- application/index/controller/Safety.php | 2 +- application/index/controller/Search.php | 4 +- application/index/controller/User.php | 8 +- application/index/controller/Useraddress.php | 2 +- application/index/controller/Userfavor.php | 2 +- .../index/controller/Usergoodsbrowse.php | 2 +- application/index/controller/Userintegral.php | 2 +- .../index/view/default/order/qrcode_pay.html | 0 application/service/AdminPowerService.php | 32 ++-- application/service/AdminService.php | 20 +-- application/service/AnswerService.php | 14 +- application/service/AppMiniService.php | 54 +++---- application/service/AppNavService.php | 16 +- application/service/ArticleService.php | 30 ++-- application/service/BannerService.php | 4 +- application/service/BrandService.php | 30 ++-- application/service/BuyService.php | 58 +++---- application/service/ConfigService.php | 14 +- application/service/CustomViewService.php | 20 +-- application/service/ExpressService.php | 12 +- application/service/GoodsService.php | 142 +++++++++--------- application/service/IntegralService.php | 18 +-- application/service/LinkService.php | 10 +- application/service/MessageService.php | 22 +-- application/service/NavigationService.php | 28 ++-- application/service/OrderService.php | 75 +++++---- application/service/PayLogService.php | 10 +- application/service/PaymentService.php | 134 ++++++++--------- application/service/RegionService.php | 12 +- application/service/ResourcesService.php | 10 +- application/service/SafetyService.php | 20 +-- application/service/ScreeningPriceService.php | 8 +- application/service/SearchService.php | 12 +- application/service/SlideService.php | 14 +- application/service/ThemeService.php | 24 +-- application/service/UserService.php | 89 ++++++----- 130 files changed, 576 insertions(+), 1642 deletions(-) mode change 100644 => 100755 application/api/config/app.php mode change 100644 => 100755 application/api/controller/Banner.php mode change 100644 => 100755 application/api/controller/Buy.php mode change 100644 => 100755 application/api/controller/Cart.php mode change 100644 => 100755 application/api/controller/Goods.php mode change 100644 => 100755 application/api/controller/Navigation.php mode change 100644 => 100755 application/api/controller/Order.php mode change 100644 => 100755 application/api/controller/Region.php mode change 100644 => 100755 application/api/controller/Search.php mode change 100644 => 100755 application/api/controller/User.php mode change 100644 => 100755 application/api/controller/Useraddress.php delete mode 100644 application/facade/AdminPowerService.php delete mode 100644 application/facade/AdminService.php delete mode 100644 application/facade/AnswerService.php delete mode 100644 application/facade/AppMiniService.php delete mode 100644 application/facade/AppNavService.php delete mode 100644 application/facade/ArticleService.php delete mode 100644 application/facade/BannerService.php delete mode 100644 application/facade/BrandService.php delete mode 100644 application/facade/BuyService.php delete mode 100644 application/facade/ConfigService.php delete mode 100644 application/facade/CustomViewService.php delete mode 100644 application/facade/ExpressService.php delete mode 100644 application/facade/GoodsService.php delete mode 100644 application/facade/IntegralService.php delete mode 100644 application/facade/LinkService.php delete mode 100644 application/facade/MessageService.php delete mode 100644 application/facade/NavigationService.php delete mode 100644 application/facade/OrderService.php delete mode 100644 application/facade/PayLogService.php delete mode 100644 application/facade/PaymentService.php delete mode 100644 application/facade/RegionService.php delete mode 100644 application/facade/ResourcesService.php delete mode 100644 application/facade/SafetyService.php delete mode 100644 application/facade/ScreeningPriceService.php delete mode 100644 application/facade/SearchService.php delete mode 100644 application/facade/SlideService.php delete mode 100644 application/facade/ThemeService.php delete mode 100644 application/facade/UserService.php mode change 100644 => 100755 application/index/view/default/order/qrcode_pay.html diff --git a/application/admin/controller/Admin.php b/application/admin/controller/Admin.php index 6f33bddbf..d41e61495 100755 --- a/application/admin/controller/Admin.php +++ b/application/admin/controller/Admin.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\AdminService; +use app\service\AdminService; /** * 管理员 diff --git a/application/admin/controller/Answer.php b/application/admin/controller/Answer.php index 42dcd53de..998d79130 100755 --- a/application/admin/controller/Answer.php +++ b/application/admin/controller/Answer.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\AnswerService; +use app\service\AnswerService; /** * 问答管理 diff --git a/application/admin/controller/Appconfig.php b/application/admin/controller/Appconfig.php index 36a8b7a6a..53b0d1540 100755 --- a/application/admin/controller/Appconfig.php +++ b/application/admin/controller/Appconfig.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ConfigService; +use app\service\ConfigService; /** * 手机端 - 配置 diff --git a/application/admin/controller/Apphomenav.php b/application/admin/controller/Apphomenav.php index 5e675a50b..489ce903c 100755 --- a/application/admin/controller/Apphomenav.php +++ b/application/admin/controller/Apphomenav.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\AppNavService; +use app\service\AppNavService; /** * 手机管理-首页导航管理 diff --git a/application/admin/controller/Appminialipayconfig.php b/application/admin/controller/Appminialipayconfig.php index 8442b2a5a..4f88cc33c 100755 --- a/application/admin/controller/Appminialipayconfig.php +++ b/application/admin/controller/Appminialipayconfig.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ConfigService; +use app\service\ConfigService; /** * 支付宝小程序 - 配置 diff --git a/application/admin/controller/Appminialipaylist.php b/application/admin/controller/Appminialipaylist.php index 0e0370ed4..25c6296f4 100755 --- a/application/admin/controller/Appminialipaylist.php +++ b/application/admin/controller/Appminialipaylist.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\AppMiniService; +use app\service\AppMiniService; /** * 支付宝小程序管理 diff --git a/application/admin/controller/Appminiweixinconfig.php b/application/admin/controller/Appminiweixinconfig.php index c785855c3..1ffb9c499 100755 --- a/application/admin/controller/Appminiweixinconfig.php +++ b/application/admin/controller/Appminiweixinconfig.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ConfigService; +use app\service\ConfigService; /** * 微信小程序 - 配置 diff --git a/application/admin/controller/Appminiweixinlist.php b/application/admin/controller/Appminiweixinlist.php index 62f2d182b..7abbd9983 100755 --- a/application/admin/controller/Appminiweixinlist.php +++ b/application/admin/controller/Appminiweixinlist.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\AppMiniService; +use app\service\AppMiniService; /** * 微信小程序管理 diff --git a/application/admin/controller/Article.php b/application/admin/controller/Article.php index 7c860a654..e08c3efae 100755 --- a/application/admin/controller/Article.php +++ b/application/admin/controller/Article.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ArticleService; +use app\service\ArticleService; /** * 文章管理 diff --git a/application/admin/controller/Articlecategory.php b/application/admin/controller/Articlecategory.php index 31ee3793b..b878fb6e2 100755 --- a/application/admin/controller/Articlecategory.php +++ b/application/admin/controller/Articlecategory.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ArticleService; +use app\service\ArticleService; /** * 文章分类管理 diff --git a/application/admin/controller/Brand.php b/application/admin/controller/Brand.php index 49d913b7d..ad0ba3840 100755 --- a/application/admin/controller/Brand.php +++ b/application/admin/controller/Brand.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\BrandService; +use app\service\BrandService; /** * 品牌管理 diff --git a/application/admin/controller/Brandcategory.php b/application/admin/controller/Brandcategory.php index 2683eda67..40727c12a 100755 --- a/application/admin/controller/Brandcategory.php +++ b/application/admin/controller/Brandcategory.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\BrandService; +use app\service\BrandService; /** * 品牌分类管理 diff --git a/application/admin/controller/Common.php b/application/admin/controller/Common.php index b1f475ecc..6dbd4e079 100755 --- a/application/admin/controller/Common.php +++ b/application/admin/controller/Common.php @@ -11,8 +11,8 @@ namespace app\admin\controller; use think\Controller; -use app\facade\AdminPowerService; -use app\facade\ConfigService; +use app\service\AdminPowerService; +use app\service\ConfigService; /** * 管理员公共控制器 diff --git a/application/admin/controller/Config.php b/application/admin/controller/Config.php index 9900ab4e6..e57e469fb 100755 --- a/application/admin/controller/Config.php +++ b/application/admin/controller/Config.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ConfigService; +use app\service\ConfigService; /** * 配置设置 diff --git a/application/admin/controller/Customview.php b/application/admin/controller/Customview.php index 180b2c2b1..f72b64e7b 100755 --- a/application/admin/controller/Customview.php +++ b/application/admin/controller/Customview.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\CustomViewService; +use app\service\CustomViewService; /** * 自定义页面管理 diff --git a/application/admin/controller/Email.php b/application/admin/controller/Email.php index cbe98907d..bdc401b55 100755 --- a/application/admin/controller/Email.php +++ b/application/admin/controller/Email.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ConfigService; +use app\service\ConfigService; /** * 邮箱设置 diff --git a/application/admin/controller/Express.php b/application/admin/controller/Express.php index ece1602b3..d8d5df9c0 100755 --- a/application/admin/controller/Express.php +++ b/application/admin/controller/Express.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ExpressService; +use app\service\ExpressService; /** * 快递管理 diff --git a/application/admin/controller/Goods.php b/application/admin/controller/Goods.php index c7b4ee80a..c7fc74657 100755 --- a/application/admin/controller/Goods.php +++ b/application/admin/controller/Goods.php @@ -10,10 +10,10 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ResourcesService; -use app\facade\GoodsService; -use app\facade\RegionService; -use app\facade\BrandService; +use app\service\ResourcesService; +use app\service\GoodsService; +use app\service\RegionService; +use app\service\BrandService; /** * 商品管理 diff --git a/application/admin/controller/Goodscategory.php b/application/admin/controller/Goodscategory.php index a38856cae..6224b9447 100755 --- a/application/admin/controller/Goodscategory.php +++ b/application/admin/controller/Goodscategory.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\GoodsService; +use app\service\GoodsService; /** * 分类管理 diff --git a/application/admin/controller/Integrallog.php b/application/admin/controller/Integrallog.php index c7d47315c..df1f03d30 100755 --- a/application/admin/controller/Integrallog.php +++ b/application/admin/controller/Integrallog.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\IntegralService; +use app\service\IntegralService; /** * 用户积分日志管理 diff --git a/application/admin/controller/Link.php b/application/admin/controller/Link.php index d3cf27367..a641f8fca 100755 --- a/application/admin/controller/Link.php +++ b/application/admin/controller/Link.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\LinkService; +use app\service\LinkService; /** * 友情链接 diff --git a/application/admin/controller/Message.php b/application/admin/controller/Message.php index 417139b04..a39d2dcc4 100755 --- a/application/admin/controller/Message.php +++ b/application/admin/controller/Message.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\MessageService; +use app\service\MessageService; /** * 消息管理 diff --git a/application/admin/controller/Navigation.php b/application/admin/controller/Navigation.php index 695a67778..deb0a003d 100755 --- a/application/admin/controller/Navigation.php +++ b/application/admin/controller/Navigation.php @@ -10,9 +10,9 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ArticleService; -use app\facade\NavigationService; -use app\facade\GoodsService; +use app\service\ArticleService; +use app\service\NavigationService; +use app\service\GoodsService; /** * 导航管理 diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index 9f747cc58..58026a3d3 100755 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -10,9 +10,9 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\OrderService; -use app\facade\PaymentService; -use app\facade\ExpressService; +use app\service\OrderService; +use app\service\PaymentService; +use app\service\ExpressService; /** * 订单管理 diff --git a/application/admin/controller/Paylog.php b/application/admin/controller/Paylog.php index ac478480c..5d28771ca 100755 --- a/application/admin/controller/Paylog.php +++ b/application/admin/controller/Paylog.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\PayLogService; +use app\service\PayLogService; /** * 支付日志管理 diff --git a/application/admin/controller/Payment.php b/application/admin/controller/Payment.php index 67a77c340..cd2cf7d77 100755 --- a/application/admin/controller/Payment.php +++ b/application/admin/controller/Payment.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\PaymentService; +use app\service\PaymentService; /** * 支付方式管理 @@ -53,7 +53,7 @@ class Payment extends Common $this->assign('data_list', PaymentService::PlugPaymentList()); // 不删除的支付方式 - $this->assign('cannot_deleted_list', config('shopxo.payment_cannot_deleted_list')); + $this->assign('cannot_deleted_list', PaymentService::$cannot_deleted_list); // 适用平台 $this->assign('common_platform_type', lang('common_platform_type')); diff --git a/application/admin/controller/Power.php b/application/admin/controller/Power.php index 5977fdc67..e363ce271 100755 --- a/application/admin/controller/Power.php +++ b/application/admin/controller/Power.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\AdminPowerService; +use app\service\AdminPowerService; /** * 权限管理 diff --git a/application/admin/controller/Region.php b/application/admin/controller/Region.php index d51acadfb..c1a77faa4 100755 --- a/application/admin/controller/Region.php +++ b/application/admin/controller/Region.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\RegionService; +use app\service\RegionService; /** * 地区管理 diff --git a/application/admin/controller/Screeningprice.php b/application/admin/controller/Screeningprice.php index 6725be29b..cffd8a005 100755 --- a/application/admin/controller/Screeningprice.php +++ b/application/admin/controller/Screeningprice.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ScreeningPriceService; +use app\service\ScreeningPriceService; /** * 筛选价格管理 diff --git a/application/admin/controller/Seo.php b/application/admin/controller/Seo.php index a58eb7f64..4f01b9d53 100755 --- a/application/admin/controller/Seo.php +++ b/application/admin/controller/Seo.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ConfigService; +use app\service\ConfigService; /** * seo设置 diff --git a/application/admin/controller/Site.php b/application/admin/controller/Site.php index aae354811..f8efba29f 100755 --- a/application/admin/controller/Site.php +++ b/application/admin/controller/Site.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ConfigService; +use app\service\ConfigService; /** * 站点设置 diff --git a/application/admin/controller/Slide.php b/application/admin/controller/Slide.php index d5b214946..9f07fe04d 100755 --- a/application/admin/controller/Slide.php +++ b/application/admin/controller/Slide.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\SlideService; +use app\service\SlideService; /** * 轮播图片管理 diff --git a/application/admin/controller/Sms.php b/application/admin/controller/Sms.php index 74f97ac19..a60b82fd2 100755 --- a/application/admin/controller/Sms.php +++ b/application/admin/controller/Sms.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ConfigService; +use app\service\ConfigService; /** * 短信设置 diff --git a/application/admin/controller/Theme.php b/application/admin/controller/Theme.php index 75bf368cd..f107b9784 100755 --- a/application/admin/controller/Theme.php +++ b/application/admin/controller/Theme.php @@ -10,8 +10,8 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\ThemeService; -use app\facade\ConfigService; +use app\service\ThemeService; +use app\service\ConfigService; /** * 主题管理 diff --git a/application/admin/controller/User.php b/application/admin/controller/User.php index 9deef94d3..fcc4480cc 100755 --- a/application/admin/controller/User.php +++ b/application/admin/controller/User.php @@ -10,8 +10,8 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; -use app\facade\IntegralService; -use app\facade\UserService; +use app\service\IntegralService; +use app\service\UserService; /** * 用户管理 diff --git a/application/admin/view/default/screeningprice/index.html b/application/admin/view/default/screeningprice/index.html index dd15a3505..448be00c2 100755 --- a/application/admin/view/default/screeningprice/index.html +++ b/application/admin/view/default/screeningprice/index.html @@ -19,7 +19,7 @@
规则举例
最小价格0 - 最大价格100 则是小于100
最小价格1000 - 最大价格0 则是大于1000
最小价格100 - 最大价格500 则是大于等于100并且小于500
-
+
diff --git a/application/api/config/app.php b/application/api/config/app.php old mode 100644 new mode 100755 diff --git a/application/api/controller/Answer.php b/application/api/controller/Answer.php index 78aeaacad..ff909c02a 100755 --- a/application/api/controller/Answer.php +++ b/application/api/controller/Answer.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\AnswerService; +use app\service\AnswerService; /** * 用户留言 diff --git a/application/api/controller/Banner.php b/application/api/controller/Banner.php old mode 100644 new mode 100755 index a71a36b8e..f68baf646 --- a/application/api/controller/Banner.php +++ b/application/api/controller/Banner.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\BannerService; +use app\service\BannerService; /** * 轮播 diff --git a/application/api/controller/Buy.php b/application/api/controller/Buy.php old mode 100644 new mode 100755 index 3af070608..71fd6dce4 --- a/application/api/controller/Buy.php +++ b/application/api/controller/Buy.php @@ -10,10 +10,10 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\GoodsService; -use app\facade\UserService; -use app\facade\PaymentService; -use app\facade\BuyService; +use app\service\GoodsService; +use app\service\UserService; +use app\service\PaymentService; +use app\service\BuyService; /** * 购买 diff --git a/application/api/controller/Cart.php b/application/api/controller/Cart.php old mode 100644 new mode 100755 index ad2eeb073..5873d0d74 --- a/application/api/controller/Cart.php +++ b/application/api/controller/Cart.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\BuyService; +use app\service\BuyService; /** * 购物车 diff --git a/application/api/controller/Common.php b/application/api/controller/Common.php index e607e475e..f1b4e4579 100755 --- a/application/api/controller/Common.php +++ b/application/api/controller/Common.php @@ -11,8 +11,8 @@ namespace app\api\controller; use think\Controller; -use app\facade\ConfigService; -use app\facade\UserService; +use app\service\ConfigService; +use app\service\UserService; /** * 接口公共控制器 diff --git a/application/api/controller/Goods.php b/application/api/controller/Goods.php old mode 100644 new mode 100755 index acf46a06b..38076d971 --- a/application/api/controller/Goods.php +++ b/application/api/controller/Goods.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\GoodsService; +use app\service\GoodsService; /** * 商品 diff --git a/application/api/controller/Index.php b/application/api/controller/Index.php index 9fcbeab59..aa0acff11 100755 --- a/application/api/controller/Index.php +++ b/application/api/controller/Index.php @@ -10,9 +10,9 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\GoodsService; -use app\facade\BannerService; -use app\facade\AppNavService; +use app\service\GoodsService; +use app\service\BannerService; +use app\service\AppNavService; /** * 首页 diff --git a/application/api/controller/Message.php b/application/api/controller/Message.php index 93c9371f7..c1343a6eb 100755 --- a/application/api/controller/Message.php +++ b/application/api/controller/Message.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\MessageService; +use app\service\MessageService; /** * 消息 diff --git a/application/api/controller/Navigation.php b/application/api/controller/Navigation.php old mode 100644 new mode 100755 index 3e7461d6d..c952694e9 --- a/application/api/controller/Navigation.php +++ b/application/api/controller/Navigation.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\AppNavService; +use app\service\AppNavService; /** * 导航 diff --git a/application/api/controller/Order.php b/application/api/controller/Order.php old mode 100644 new mode 100755 index 703bc0c17..9cf71d5a1 --- a/application/api/controller/Order.php +++ b/application/api/controller/Order.php @@ -10,8 +10,8 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\PaymentService; -use app\facade\OrderService; +use app\service\PaymentService; +use app\service\OrderService; /** * 我的订单 diff --git a/application/api/controller/Ordernotify.php b/application/api/controller/Ordernotify.php index 3d3e0b4e2..a27e03a73 100755 --- a/application/api/controller/Ordernotify.php +++ b/application/api/controller/Ordernotify.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\OrderService; +use app\service\OrderService; /** * 订单支付异步通知 diff --git a/application/api/controller/Region.php b/application/api/controller/Region.php old mode 100644 new mode 100755 index c1ca9b83d..f659795bc --- a/application/api/controller/Region.php +++ b/application/api/controller/Region.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\RegionService; +use app\service\RegionService; /** * 地区 diff --git a/application/api/controller/Search.php b/application/api/controller/Search.php old mode 100644 new mode 100755 index 25884c776..eae199f1f --- a/application/api/controller/Search.php +++ b/application/api/controller/Search.php @@ -10,8 +10,8 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\SearchService; -use app\facade\GoodsService; +use app\service\SearchService; +use app\service\GoodsService; /** * 商品搜索 diff --git a/application/api/controller/User.php b/application/api/controller/User.php old mode 100644 new mode 100755 index a21eb6e1c..d6220d95c --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -10,10 +10,10 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\UserService; -use app\facade\OrderService; -use app\facade\GoodsService; -use app\facade\MessageService; +use app\service\UserService; +use app\service\OrderService; +use app\service\GoodsService; +use app\service\MessageService; /** * 用户 diff --git a/application/api/controller/Useraddress.php b/application/api/controller/Useraddress.php old mode 100644 new mode 100755 index a6bbfd956..e0dcc7040 --- a/application/api/controller/Useraddress.php +++ b/application/api/controller/Useraddress.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\UserService; +use app\service\UserService; /** * 用户地址 diff --git a/application/api/controller/Usergoodsbrowse.php b/application/api/controller/Usergoodsbrowse.php index c83d1942f..098157880 100755 --- a/application/api/controller/Usergoodsbrowse.php +++ b/application/api/controller/Usergoodsbrowse.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\GoodsService; +use app\service\GoodsService; /** * 用户商品浏览 diff --git a/application/api/controller/Usergoodsfavor.php b/application/api/controller/Usergoodsfavor.php index 3a3bd46d9..76922b0b5 100755 --- a/application/api/controller/Usergoodsfavor.php +++ b/application/api/controller/Usergoodsfavor.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\GoodsService; +use app\service\GoodsService; /** * 用户商品收藏 diff --git a/application/api/controller/Userintegral.php b/application/api/controller/Userintegral.php index d6e610fb9..c95b3cee2 100755 --- a/application/api/controller/Userintegral.php +++ b/application/api/controller/Userintegral.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\api\controller; -use app\facade\IntegralService; +use app\service\IntegralService; /** * 用户积分管理 diff --git a/application/facade/AdminPowerService.php b/application/facade/AdminPowerService.php deleted file mode 100644 index 9b1f11762..000000000 --- a/application/facade/AdminPowerService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/AdminService.php b/application/facade/AdminService.php deleted file mode 100644 index 32f11f231..000000000 --- a/application/facade/AdminService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/AnswerService.php b/application/facade/AnswerService.php deleted file mode 100644 index 2a4529dfb..000000000 --- a/application/facade/AnswerService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/AppMiniService.php b/application/facade/AppMiniService.php deleted file mode 100644 index c42e014ad..000000000 --- a/application/facade/AppMiniService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/AppNavService.php b/application/facade/AppNavService.php deleted file mode 100644 index e24fd8715..000000000 --- a/application/facade/AppNavService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/ArticleService.php b/application/facade/ArticleService.php deleted file mode 100644 index 93580adb9..000000000 --- a/application/facade/ArticleService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/BannerService.php b/application/facade/BannerService.php deleted file mode 100644 index c6e5a3c39..000000000 --- a/application/facade/BannerService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/BrandService.php b/application/facade/BrandService.php deleted file mode 100644 index 7aced48ae..000000000 --- a/application/facade/BrandService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/BuyService.php b/application/facade/BuyService.php deleted file mode 100644 index 455322d6f..000000000 --- a/application/facade/BuyService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/ConfigService.php b/application/facade/ConfigService.php deleted file mode 100644 index d8b917727..000000000 --- a/application/facade/ConfigService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/CustomViewService.php b/application/facade/CustomViewService.php deleted file mode 100644 index d5365eaa1..000000000 --- a/application/facade/CustomViewService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/ExpressService.php b/application/facade/ExpressService.php deleted file mode 100644 index 3800e6701..000000000 --- a/application/facade/ExpressService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/GoodsService.php b/application/facade/GoodsService.php deleted file mode 100644 index 55d0bfda3..000000000 --- a/application/facade/GoodsService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/IntegralService.php b/application/facade/IntegralService.php deleted file mode 100644 index 73d14328a..000000000 --- a/application/facade/IntegralService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/LinkService.php b/application/facade/LinkService.php deleted file mode 100644 index 11a4df8b6..000000000 --- a/application/facade/LinkService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/MessageService.php b/application/facade/MessageService.php deleted file mode 100644 index d28d5309a..000000000 --- a/application/facade/MessageService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/NavigationService.php b/application/facade/NavigationService.php deleted file mode 100644 index 55b4e7e31..000000000 --- a/application/facade/NavigationService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/OrderService.php b/application/facade/OrderService.php deleted file mode 100644 index d1219056f..000000000 --- a/application/facade/OrderService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/PayLogService.php b/application/facade/PayLogService.php deleted file mode 100644 index 78a5e0497..000000000 --- a/application/facade/PayLogService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/PaymentService.php b/application/facade/PaymentService.php deleted file mode 100644 index 82e89d601..000000000 --- a/application/facade/PaymentService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/RegionService.php b/application/facade/RegionService.php deleted file mode 100644 index c02d4f87e..000000000 --- a/application/facade/RegionService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/ResourcesService.php b/application/facade/ResourcesService.php deleted file mode 100644 index b10f2a63d..000000000 --- a/application/facade/ResourcesService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/SafetyService.php b/application/facade/SafetyService.php deleted file mode 100644 index 2c70bd73f..000000000 --- a/application/facade/SafetyService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/ScreeningPriceService.php b/application/facade/ScreeningPriceService.php deleted file mode 100644 index fa644537a..000000000 --- a/application/facade/ScreeningPriceService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/SearchService.php b/application/facade/SearchService.php deleted file mode 100644 index c1edac0d4..000000000 --- a/application/facade/SearchService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/SlideService.php b/application/facade/SlideService.php deleted file mode 100644 index c2eadd46d..000000000 --- a/application/facade/SlideService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/ThemeService.php b/application/facade/ThemeService.php deleted file mode 100644 index 8536ecd6b..000000000 --- a/application/facade/ThemeService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/facade/UserService.php b/application/facade/UserService.php deleted file mode 100644 index d4df279f3..000000000 --- a/application/facade/UserService.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/application/index/controller/Article.php b/application/index/controller/Article.php index e58c0c3b8..a04b1239c 100755 --- a/application/index/controller/Article.php +++ b/application/index/controller/Article.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\ArticleService; +use app\service\ArticleService; /** * 文章详情 diff --git a/application/index/controller/Buy.php b/application/index/controller/Buy.php index 36c4b1057..315a59387 100755 --- a/application/index/controller/Buy.php +++ b/application/index/controller/Buy.php @@ -10,10 +10,10 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\GoodsService; -use app\facade\UserService; -use app\facade\PaymentService; -use app\facade\BuyService; +use app\service\GoodsService; +use app\service\UserService; +use app\service\PaymentService; +use app\service\BuyService; /** * 购买 diff --git a/application/index/controller/Cart.php b/application/index/controller/Cart.php index a5c312117..3e7f15f8f 100755 --- a/application/index/controller/Cart.php +++ b/application/index/controller/Cart.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\BuyService; +use app\service\BuyService; /** * 购物车 diff --git a/application/index/controller/Common.php b/application/index/controller/Common.php index f516d4568..bf575f593 100755 --- a/application/index/controller/Common.php +++ b/application/index/controller/Common.php @@ -11,13 +11,13 @@ namespace app\index\controller; use think\Controller; -use app\facade\GoodsService; -use app\facade\NavigationService; -use app\facade\BuyService; -use app\facade\MessageService; -use app\facade\SearchService; -use app\facade\ConfigService; -use app\facade\LinkService; +use app\service\GoodsService; +use app\service\NavigationService; +use app\service\BuyService; +use app\service\MessageService; +use app\service\SearchService; +use app\service\ConfigService; +use app\service\LinkService; /** * 前端公共控制器 diff --git a/application/index/controller/Customview.php b/application/index/controller/Customview.php index 955a0b424..2dea84a59 100755 --- a/application/index/controller/Customview.php +++ b/application/index/controller/Customview.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\CustomViewService; +use app\service\CustomViewService; /** * 自定义页面 diff --git a/application/index/controller/Goods.php b/application/index/controller/Goods.php index 188e53204..0b76ebea2 100755 --- a/application/index/controller/Goods.php +++ b/application/index/controller/Goods.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\GoodsService; +use app\service\GoodsService; /** * 商品详情 diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index e871c270b..53a690bdf 100755 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -10,10 +10,10 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\BannerService; -use app\facade\GoodsService; -use app\facade\ArticleService; -use app\facade\OrderService; +use app\service\BannerService; +use app\service\GoodsService; +use app\service\ArticleService; +use app\service\OrderService; /** * 首页 diff --git a/application/index/controller/Message.php b/application/index/controller/Message.php index 3b0bd3799..d9936998d 100755 --- a/application/index/controller/Message.php +++ b/application/index/controller/Message.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\MessageService; +use app\service\MessageService; /** * 消息管理 diff --git a/application/index/controller/Order.php b/application/index/controller/Order.php index aa00d298e..119a4ca5c 100755 --- a/application/index/controller/Order.php +++ b/application/index/controller/Order.php @@ -10,8 +10,8 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\OrderService; -use app\facade\PaymentService; +use app\service\OrderService; +use app\service\PaymentService; /** * 订单管理 diff --git a/application/index/controller/Personal.php b/application/index/controller/Personal.php index 9f4e1f8be..6ca941880 100755 --- a/application/index/controller/Personal.php +++ b/application/index/controller/Personal.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\UserService; +use app\service\UserService; /** * 个人资料 diff --git a/application/index/controller/Region.php b/application/index/controller/Region.php index 4fbc2c299..f507c106a 100755 --- a/application/index/controller/Region.php +++ b/application/index/controller/Region.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\RegionService; +use app\service\RegionService; /** * 地区 diff --git a/application/index/controller/Safety.php b/application/index/controller/Safety.php index 893ab28c1..b92328ea2 100755 --- a/application/index/controller/Safety.php +++ b/application/index/controller/Safety.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\SafetyService; +use app\service\SafetyService; /** * 安全 diff --git a/application/index/controller/Search.php b/application/index/controller/Search.php index f8c0ed099..ad4cab1cf 100755 --- a/application/index/controller/Search.php +++ b/application/index/controller/Search.php @@ -10,8 +10,8 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\SearchService; -use app\facade\BrandService; +use app\service\SearchService; +use app\service\BrandService; /** * 搜索 diff --git a/application/index/controller/User.php b/application/index/controller/User.php index 9160394eb..fe50ced4c 100755 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -10,10 +10,10 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\OrderService; -use app\facade\GoodsService; -use app\facade\UserService; -use app\facade\BuyService; +use app\service\OrderService; +use app\service\GoodsService; +use app\service\UserService; +use app\service\BuyService; /** * 用户 diff --git a/application/index/controller/Useraddress.php b/application/index/controller/Useraddress.php index 4e3109f23..19995c2d6 100755 --- a/application/index/controller/Useraddress.php +++ b/application/index/controller/Useraddress.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\UserService; +use app\service\UserService; /** * 用户地址管理 diff --git a/application/index/controller/Userfavor.php b/application/index/controller/Userfavor.php index 6158ac285..707e2e701 100755 --- a/application/index/controller/Userfavor.php +++ b/application/index/controller/Userfavor.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\GoodsService; +use app\service\GoodsService; /** * 用户收藏 diff --git a/application/index/controller/Usergoodsbrowse.php b/application/index/controller/Usergoodsbrowse.php index a764ffd2b..02556d913 100755 --- a/application/index/controller/Usergoodsbrowse.php +++ b/application/index/controller/Usergoodsbrowse.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\GoodsService; +use app\service\GoodsService; /** * 用户商品浏览 diff --git a/application/index/controller/Userintegral.php b/application/index/controller/Userintegral.php index 9969b04f5..1e4808e4f 100755 --- a/application/index/controller/Userintegral.php +++ b/application/index/controller/Userintegral.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; -use app\facade\IntegralService; +use app\service\IntegralService; /** * 用户积分管理 diff --git a/application/index/view/default/order/qrcode_pay.html b/application/index/view/default/order/qrcode_pay.html old mode 100644 new mode 100755 diff --git a/application/service/AdminPowerService.php b/application/service/AdminPowerService.php index ba40750c1..16489fe3e 100755 --- a/application/service/AdminPowerService.php +++ b/application/service/AdminPowerService.php @@ -13,7 +13,7 @@ namespace app\service; use think\Db; /** - * 管理员权限服务层 + * 权限服务层 * @author Devil * @blog http://gong.gg/ * @version 0.0.1 @@ -29,7 +29,7 @@ class AdminPowerService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function PowerList($params = []) + public static function PowerList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? '*' : $params['field']; @@ -55,7 +55,7 @@ class AdminPowerService * @datetime 2018-12-07T00:24:14+0800 * @param [array] $params [输入参数] */ - public function PowerSave($params = []) + public static function PowerSave($params = []) { // 请求参数 $p = [ @@ -128,7 +128,7 @@ class AdminPowerService if(Db::name('Power')->insertGetId($data) > 0) { // 清除用户权限数据 - $this->PowerCacheDelete(); + self::PowerCacheDelete(); return DataReturn('添加成功', 0); } @@ -137,7 +137,7 @@ class AdminPowerService if(Db::name('Power')->where(['id'=>intval($params['id'])])->update($data) !== false) { // 清除用户权限数据 - $this->PowerCacheDelete(); + self::PowerCacheDelete(); return DataReturn('更新成功', 0); } @@ -153,7 +153,7 @@ class AdminPowerService * @datetime 2018-12-07T00:24:14+0800 * @param [array] $params [输入参数] */ - public function PowerDelete($params = []) + public static function PowerDelete($params = []) { // 参数是否有误 if(empty($params['id'])) @@ -164,7 +164,7 @@ class AdminPowerService if(Db::name('Power')->delete(intval($params['id']))) { // 清除用户权限数据 - $this->PowerCacheDelete(); + self::PowerCacheDelete(); return DataReturn('删除成功', 0); } @@ -179,7 +179,7 @@ class AdminPowerService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function RoleList($params = []) + public static function RoleList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? '*' : $params['field']; @@ -211,7 +211,7 @@ class AdminPowerService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function RoleStatusUpdate($params = []) + public static function RoleStatusUpdate($params = []) { // 请求参数 $p = [ @@ -249,7 +249,7 @@ class AdminPowerService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function RolePowerEditData($params = []) + public static function RolePowerEditData($params = []) { // 当前角色关联的所有菜单id $action = empty($params['role_id']) ? [] : Db::name('RolePower')->where(['role_id'=>$params['role_id']])->column('power_id'); @@ -287,7 +287,7 @@ class AdminPowerService * @datetime 2018-12-07T00:24:14+0800 * @param [array] $params [输入参数] */ - public function RoleSave($params = []) + public static function RoleSave($params = []) { // 请求参数 $p = [ @@ -369,7 +369,7 @@ class AdminPowerService Db::commit(); // 清除用户权限数据 - $this->PowerCacheDelete(); + self::PowerCacheDelete(); return DataReturn('操作成功', 0); } @@ -382,7 +382,7 @@ class AdminPowerService * @datetime 2018-12-07T00:24:14+0800 * @param [array] $params [输入参数] */ - public function RoleDelete($params = []) + public static function RoleDelete($params = []) { // 参数是否有误 if(empty($params['id'])) @@ -400,7 +400,7 @@ class AdminPowerService Db::commit(); // 清除用户权限数据 - $this->PowerCacheDelete(); + self::PowerCacheDelete(); return DataReturn('删除成功', 0); } @@ -416,7 +416,7 @@ class AdminPowerService * @version 0.0.1 * @datetime 2017-02-26T23:45:26+0800 */ - public function PowerCacheDelete() + public static function PowerCacheDelete() { $admin = Db::name('Admin')->column('id'); if(!empty($admin)) @@ -437,7 +437,7 @@ class AdminPowerService * @date 2018-12-06 * @desc description */ - public function PowerMenuInit() + public static function PowerMenuInit() { // 基础参数 $admin = session('admin'); diff --git a/application/service/AdminService.php b/application/service/AdminService.php index d1d6f1091..d0d391a7d 100755 --- a/application/service/AdminService.php +++ b/application/service/AdminService.php @@ -29,7 +29,7 @@ class AdminService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function AdminList($params = []) + public static function AdminList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? '*' : $params['field']; @@ -58,7 +58,7 @@ class AdminService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $params [输入参数] */ - public function AdminListWhere($params = []) + public static function AdminListWhere($params = []) { $where = []; if(!empty($params['username'])) @@ -86,7 +86,7 @@ class AdminService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $where [条件] */ - public function AdminTotal($where) + public static function AdminTotal($where) { return (int) Db::name('Admin')->where($where)->count(); } @@ -99,7 +99,7 @@ class AdminService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $params [输入参数] */ - public function RoleList($params = []) + public static function RoleList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? '*' : $params['field']; @@ -114,7 +114,7 @@ class AdminService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $params [输入参数] */ - public function AdminSave($params = []) + public static function AdminSave($params = []) { // 请求参数 $p = [ @@ -142,7 +142,7 @@ class AdminService { return DataReturn($ret, -1); } - return empty($params['id']) ? $this->AdminInsert($params) : $this->AdminUpdate($params); + return empty($params['id']) ? self::AdminInsert($params) : self::AdminUpdate($params); } /** @@ -153,7 +153,7 @@ class AdminService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $params [输入参数] */ - public function AdminInsert($params = []) + public static function AdminInsert($params = []) { // 请求参数 $p = [ @@ -219,7 +219,7 @@ class AdminService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $params [输入参数] */ - public function AdminUpdate($params = []) + public static function AdminUpdate($params = []) { // 请求参数 $p = [ @@ -286,7 +286,7 @@ class AdminService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $params [输入参数] */ - public function AdminDelete($params = []) + public static function AdminDelete($params = []) { // 请求参数 $p = [ @@ -318,7 +318,7 @@ class AdminService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $params [输入参数] */ - public function Login($params = []) + public static function Login($params = []) { // 请求参数 $p = [ diff --git a/application/service/AnswerService.php b/application/service/AnswerService.php index 6c9411858..0ad9adbad 100755 --- a/application/service/AnswerService.php +++ b/application/service/AnswerService.php @@ -30,7 +30,7 @@ class AnswerService * @desc description * @param [array] $where [条件] */ - public function AnswerTotal($where = []) + public static function AnswerTotal($where = []) { return (int) Db::name('Answer')->where($where)->count(); } @@ -44,7 +44,7 @@ class AnswerService * @desc description * @param [array] $params [输入参数] */ - public function AnswerList($params = []) + public static function AnswerList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $m = isset($params['m']) ? intval($params['m']) : 0; @@ -89,7 +89,7 @@ class AnswerService * @desc description * @param [array] $params [输入参数] */ - public function AnswerListWhere($params = []) + public static function AnswerListWhere($params = []) { $where = [ ['is_delete_time', '=', 0], @@ -143,7 +143,7 @@ class AnswerService * @desc description * @param [array] $params [输入参数] */ - public function Add($params = []) + public static function Add($params = []) { // 参数校验 $p = [ @@ -198,7 +198,7 @@ class AnswerService * @desc description * @param [array] $params [输入参数] */ - public function AnswerDelete($params = []) + public static function AnswerDelete($params = []) { // 请求参数 $p = [ @@ -261,7 +261,7 @@ class AnswerService * @desc description * @param [array] $params [输入参数] */ - public function AnswerReply($params = []) + public static function AnswerReply($params = []) { // 请求参数 $p = [ @@ -320,7 +320,7 @@ class AnswerService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function AnswerStatusUpdate($params = []) + public static function AnswerStatusUpdate($params = []) { // 请求参数 $p = [ diff --git a/application/service/AppMiniService.php b/application/service/AppMiniService.php index 0987c9a7e..34b9dc91f 100755 --- a/application/service/AppMiniService.php +++ b/application/service/AppMiniService.php @@ -22,13 +22,13 @@ use think\Db; class AppMiniService { // 当前小程序包名称 - private $application_name; + private static $application_name; // 原包地址/操作地址 - private $old_root; - private $new_root; - private $old_path; - private $new_path; + private static $old_root; + private static $new_root; + private static $old_path; + private static $new_path; /** * @author Devil @@ -38,16 +38,16 @@ class AppMiniService * @desc description * @param [array] $params [输入参数] */ - public function Init($params = []) + public static function Init($params = []) { // 当前小程序包名称 - $this->application_name = isset($params['application_name']) ? $params['application_name'] : 'alipay'; + self::$application_name = isset($params['application_name']) ? $params['application_name'] : 'alipay'; // 原包地址/操作地址 - $this->old_root = ROOT.'public'.DS.'appmini'.DS.'old'; - $this->new_root = ROOT.'public'.DS.'appmini'.DS.'new'; - $this->old_path = $this->old_root.DS.$this->application_name; - $this->new_path = $this->new_root.DS.$this->application_name; + self::$old_root = ROOT.'public'.DS.'appmini'.DS.'old'; + self::$new_root = ROOT.'public'.DS.'appmini'.DS.'new'; + self::$old_path = self::$old_root.DS.self::$application_name; + self::$new_path = self::$new_root.DS.self::$application_name; } /** @@ -58,23 +58,23 @@ class AppMiniService * @datetime 2017-05-10T10:24:40+0800 * @param [array] $params [输入参数] */ - public function DataList($params = []) + public static function DataList($params = []) { // 初始化 - $this->Init($params); + self::Init($params); // 获取包列表 $result = []; - if(is_dir($this->new_path)) + if(is_dir(self::$new_path)) { - if($dh = opendir($this->new_path)) + if($dh = opendir(self::$new_path)) { while(($temp_file = readdir($dh)) !== false) { if($temp_file != '.' && $temp_file != '..') { - $file_path = $this->new_path.DS.$temp_file; - $url = __MY_PUBLIC_URL__.'appmini'.DS.'new'.DS.$this->application_name.DS.$temp_file; + $file_path = self::$new_path.DS.$temp_file; + $url = __MY_PUBLIC_URL__.'appmini'.DS.'new'.DS.self::$application_name.DS.$temp_file; $result[] = [ 'name' => $temp_file, 'url' => substr($url, -4) == '.zip' ? $url : '', @@ -98,10 +98,10 @@ class AppMiniService * @desc description * @param [array] $params [输入参数] */ - public function Created($params = []) + public static function Created($params = []) { // 初始化 - $this->Init($params); + self::Init($params); // 配置内容 if(empty($params['app_mini_title']) || empty($params['app_mini_describe'])) @@ -110,23 +110,23 @@ class AppMiniService } // 源码包目录是否存在 - if(!is_dir($this->new_root)) + if(!is_dir(self::$new_root)) { return DataReturn('源码包目录不存在', -1); } // 源码包目录是否有权限 - if(!is_writable($this->new_root)) + if(!is_writable(self::$new_root)) { return DataReturn('源码包目录没有权限', -1); } // 目录不存在则创建 - \base\FileUtil::CreateDir($this->new_path); + \base\FileUtil::CreateDir(self::$new_path); // 复制包目录 - $new_dir = $this->new_path.DS.date('YmdHis'); - if(\base\FileUtil::CopyDir($this->old_path, $new_dir) != true) + $new_dir = self::$new_path.DS.date('YmdHis'); + if(\base\FileUtil::CopyDir(self::$old_path, $new_dir) != true) { return DataReturn('项目包复制失败', -2); } @@ -174,7 +174,7 @@ class AppMiniService * @desc description * @param [array] $params [输入参数] */ - public function Delete($params = []) + public static function Delete($params = []) { // 参数 if(empty($params['id'])) @@ -183,7 +183,7 @@ class AppMiniService } // 初始化 - $this->Init($params); + self::Init($params); // 目录处理 $suffix = ''; @@ -196,7 +196,7 @@ class AppMiniService } // 防止路径回溯 - $path = $this->new_path.DS.htmlentities(str_replace(array('.', '/', '\\', ':'), '', strip_tags($name))).$suffix; + $path = self::$new_path.DS.htmlentities(str_replace(array('.', '/', '\\', ':'), '', strip_tags($name))).$suffix; // 删除压缩包 if($suffix == '.zip') diff --git a/application/service/AppNavService.php b/application/service/AppNavService.php index 929ed05ac..3a633cbb7 100755 --- a/application/service/AppNavService.php +++ b/application/service/AppNavService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\ResourcesService; +use app\service\ResourcesService; /** * APP导航服务层 @@ -30,7 +30,7 @@ class AppNavService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function AppHomeNavList($params = []) + public static function AppHomeNavList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? '*' : $params['field']; @@ -97,7 +97,7 @@ class AppNavService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $where [条件] */ - public function AppHomeNavTotal($where) + public static function AppHomeNavTotal($where) { return (int) Db::name('AppHomeNav')->where($where)->count(); } @@ -111,7 +111,7 @@ class AppNavService * @desc description * @param [array] $params [输入参数] */ - public function AppHomeNavListWhere($params = []) + public static function AppHomeNavListWhere($params = []) { $where = []; @@ -159,7 +159,7 @@ class AppNavService * @desc description * @param [array] $params [输入参数] */ - public function AppHomeNavSave($params = []) + public static function AppHomeNavSave($params = []) { // 请求类型 $p = [ @@ -250,7 +250,7 @@ class AppNavService * @desc description * @param [array] $params [输入参数] */ - public function AppHomeNavDelete($params = []) + public static function AppHomeNavDelete($params = []) { // 请求参数 $p = [ @@ -283,7 +283,7 @@ class AppNavService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function AppHomeNavStatusUpdate($params = []) + public static function AppHomeNavStatusUpdate($params = []) { // 请求参数 $p = [ @@ -322,7 +322,7 @@ class AppNavService * @desc description * @param array $params [description] */ - public function AppHomeNav($params = []) + public static function AppHomeNav($params = []) { $data = Db::name('AppHomeNav')->field('id,name,images_url,event_value,event_type,bg_color')->where(['platform'=>APPLICATION_CLIENT_TYPE, 'is_enable'=>1])->order('sort asc')->select(); if(!empty($data)) diff --git a/application/service/ArticleService.php b/application/service/ArticleService.php index 16e692765..e9390b7b5 100755 --- a/application/service/ArticleService.php +++ b/application/service/ArticleService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\ResourcesService; +use app\service\ResourcesService; /** * 文章服务层 @@ -31,7 +31,7 @@ class ArticleService * @desc description * @param [array] $params [输入参数] */ - public function ArticleList($params) + public static function ArticleList($params) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? 'a.*' : $params['field']; @@ -87,7 +87,7 @@ class ArticleService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $where [条件] */ - public function ArticleTotal($where) + public static function ArticleTotal($where) { return (int) Db::name('Article')->alias('a')->join(['__ARTICLE_CATEGORY__'=>'ac'], 'a.article_category_id=ac.id')->where($where)->count(); } @@ -101,7 +101,7 @@ class ArticleService * @desc description * @param [array] $params [输入参数] */ - public function ArticleListWhere($params = []) + public static function ArticleListWhere($params = []) { $where = []; @@ -149,7 +149,7 @@ class ArticleService * @desc description * @param [array] $params [输入参数] */ - public function ArticleSave($params = []) + public static function ArticleSave($params = []) { // 请求类型 $p = [ @@ -186,7 +186,7 @@ class ArticleService // 数据 $content = ResourcesService::ContentStaticReplace($params['content'], 'add'); - $image = $this->MatchContentImage($content); + $image = self::MatchContentImage($content); $data = [ 'title' => $params['title'], 'title_color' => empty($params['title_color']) ? '' : $params['title_color'], @@ -226,7 +226,7 @@ class ArticleService * @param [string] $content [文章内容] * @return [array] [文章图片数组(一维)] */ - private function MatchContentImage($content) + private static function MatchContentImage($content) { if(!empty($content)) { @@ -246,7 +246,7 @@ class ArticleService * @desc description * @param [array] $params [输入参数] */ - public function ArticleCategoryListContent($params = []) + public static function ArticleCategoryListContent($params = []) { $data = Db::name('ArticleCategory')->field('id,name')->where(['is_enable'=>1])->order('id asc, sort asc')->select(); if(!empty($data)) @@ -277,7 +277,7 @@ class ArticleService * @desc description * @param [array] $params [输入参数] */ - public function ArticleAccessCountInc($params = []) + public static function ArticleAccessCountInc($params = []) { if(!empty($params['id'])) { @@ -295,7 +295,7 @@ class ArticleService * @desc description * @param [array] $params [输入参数] */ - public function ArticleCategoryList($params = []) + public static function ArticleCategoryList($params = []) { $field = empty($params['field']) ? '*' : $params['field']; $order_by = empty($params['order_by']) ? 'sort asc' : trim($params['order_by']); @@ -314,7 +314,7 @@ class ArticleService * @desc description * @param [array] $params [输入参数] */ - public function ArticleDelete($params = []) + public static function ArticleDelete($params = []) { // 请求参数 $p = [ @@ -347,7 +347,7 @@ class ArticleService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function ArticleStatusUpdate($params = []) + public static function ArticleStatusUpdate($params = []) { // 请求参数 $p = [ @@ -390,7 +390,7 @@ class ArticleService * @datetime 2018-12-16T23:54:46+0800 * @param [array] $params [输入参数] */ - public function ArticleCategoryNodeSon($params = []) + public static function ArticleCategoryNodeSon($params = []) { // id $id = isset($params['id']) ? intval($params['id']) : 0; @@ -420,7 +420,7 @@ class ArticleService * @datetime 2018-12-17T01:04:03+0800 * @param [array] $params [输入参数] */ - public function ArticleCategorySave($params = []) + public static function ArticleCategorySave($params = []) { // 请求参数 $p = [ @@ -472,7 +472,7 @@ class ArticleService * @datetime 2018-12-17T02:40:29+0800 * @param [array] $params [输入参数] */ - public function ArticleCategoryDelete($params = []) + public static function ArticleCategoryDelete($params = []) { // 请求参数 $p = [ diff --git a/application/service/BannerService.php b/application/service/BannerService.php index 96bd8ed0b..7f194523c 100755 --- a/application/service/BannerService.php +++ b/application/service/BannerService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\ResourcesService; +use app\service\ResourcesService; /** * 轮播服务层 @@ -31,7 +31,7 @@ class BannerService * @desc description * @param [array] $params [输入参数] */ - public function Banner($params = []) + public static function Banner($params = []) { $banner = Db::name('Slide')->field('name,images_url,event_value,event_type,bg_color')->where(['platform'=>APPLICATION_CLIENT_TYPE, 'is_enable'=>1])->order('sort asc')->select(); if(!empty($banner)) diff --git a/application/service/BrandService.php b/application/service/BrandService.php index c2e69dd31..239fa5ea3 100755 --- a/application/service/BrandService.php +++ b/application/service/BrandService.php @@ -11,8 +11,8 @@ namespace app\service; use think\Db; -use app\facade\GoodsService; -use app\facade\ResourcesService; +use app\service\GoodsService; +use app\service\ResourcesService; /** * 品牌服务层 @@ -31,7 +31,7 @@ class BrandService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function BrandList($params = []) + public static function BrandList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? '*' : $params['field']; @@ -90,7 +90,7 @@ class BrandService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $where [条件] */ - public function BrandTotal($where) + public static function BrandTotal($where) { return (int) Db::name('Brand')->where($where)->count(); } @@ -104,7 +104,7 @@ class BrandService * @desc description * @param [array] $params [输入参数] */ - public function BrandListWhere($params = []) + public static function BrandListWhere($params = []) { $where = []; @@ -147,7 +147,7 @@ class BrandService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $where [条件] */ - public function CategoryBrand($params = []) + public static function CategoryBrand($params = []) { $data = Db::name('BrandCategory')->where(['is_enable'=>1])->select(); if(!empty($data)) @@ -169,7 +169,7 @@ class BrandService * @desc description * @param [array] $params [输入参数] */ - public function CategoryBrandList($params = []) + public static function CategoryBrandList($params = []) { $brand_where = ['is_enable'=>1]; if(!empty($params['category_id'])) @@ -203,7 +203,7 @@ class BrandService * @desc description * @param [int] $brand_id [地区id] */ - public function BrandName($brand_id = 0) + public static function BrandName($brand_id = 0) { return empty($brand_id) ? null : Db::name('Brand')->where(['id'=>intval($brand_id)])->value('name'); } @@ -217,7 +217,7 @@ class BrandService * @desc description * @param [array] $params [输入参数] */ - public function BrandCategoryList($params = []) + public static function BrandCategoryList($params = []) { $field = empty($params['field']) ? '*' : $params['field']; $order_by = empty($params['order_by']) ? 'sort asc' : trim($params['order_by']); @@ -236,7 +236,7 @@ class BrandService * @desc description * @param [array] $params [输入参数] */ - public function BrandSave($params = []) + public static function BrandSave($params = []) { // 请求类型 $p = [ @@ -312,7 +312,7 @@ class BrandService * @desc description * @param [array] $params [输入参数] */ - public function BrandDelete($params = []) + public static function BrandDelete($params = []) { // 请求参数 $p = [ @@ -345,7 +345,7 @@ class BrandService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function BrandStatusUpdate($params = []) + public static function BrandStatusUpdate($params = []) { // 请求参数 $p = [ @@ -383,7 +383,7 @@ class BrandService * @datetime 2018-12-16T23:54:46+0800 * @param [array] $params [输入参数] */ - public function BrandCategoryNodeSon($params = []) + public static function BrandCategoryNodeSon($params = []) { // id $id = isset($params['id']) ? intval($params['id']) : 0; @@ -413,7 +413,7 @@ class BrandService * @datetime 2018-12-17T01:04:03+0800 * @param [array] $params [输入参数] */ - public function BrandCategorySave($params = []) + public static function BrandCategorySave($params = []) { // 请求参数 $p = [ @@ -465,7 +465,7 @@ class BrandService * @datetime 2018-12-17T02:40:29+0800 * @param [array] $params [输入参数] */ - public function BrandCategoryDelete($params = []) + public static function BrandCategoryDelete($params = []) { // 请求参数 $p = [ diff --git a/application/service/BuyService.php b/application/service/BuyService.php index 485b5b2bf..ac284148a 100755 --- a/application/service/BuyService.php +++ b/application/service/BuyService.php @@ -11,9 +11,9 @@ namespace app\service; use think\Db; -use app\facade\GoodsService; -use app\facade\UserService; -use app\facade\ResourcesService; +use app\service\GoodsService; +use app\service\UserService; +use app\service\ResourcesService; /** * 购买服务层 @@ -33,7 +33,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function CartAdd($params = []) + public static function CartAdd($params = []) { // 请求参数 $p = [ @@ -68,7 +68,7 @@ class BuyService } // 规格处理 - $spec = $this->GoodsSpecificationsHandle($params); + $spec = self::GoodsSpecificationsHandle($params); // 获取商品基础信息 $goods_base = GoodsService::GoodsSpecDetail(['id'=>$goods_id, 'spec'=>$spec]); @@ -97,7 +97,7 @@ class BuyService $data['add_time'] = time(); if(Db::name('Cart')->insertGetId($data) > 0) { - return DataReturn('加入成功', 0, $this->UserCartTotal($params)); + return DataReturn('加入成功', 0, self::UserCartTotal($params)); } } else { $data['upd_time'] = time(); @@ -108,7 +108,7 @@ class BuyService } if(Db::name('Cart')->where($where)->update($data)) { - return DataReturn('加入成功', 0, $this->UserCartTotal($params)); + return DataReturn('加入成功', 0, self::UserCartTotal($params)); } } @@ -124,7 +124,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - private function GoodsSpecificationsHandle($params = []) + private static function GoodsSpecificationsHandle($params = []) { $spec = ''; if(!empty($params['spec'])) @@ -148,7 +148,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function CartList($params = []) + public static function CartList($params = []) { // 请求参数 $p = [ @@ -211,7 +211,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function CartDelete($params = []) + public static function CartDelete($params = []) { // 请求参数 $p = [ @@ -239,7 +239,7 @@ class BuyService ]; if(Db::name('Cart')->where($where)->delete()) { - return DataReturn('删除成功', 0, $this->UserCartTotal($params)); + return DataReturn('删除成功', 0, self::UserCartTotal($params)); } return DataReturn('删除失败或资源不存在', -100); } @@ -253,7 +253,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function CartStock($params = []) + public static function CartStock($params = []) { // 请求参数 $p = [ @@ -310,7 +310,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function BuyGoods($params = []) + public static function BuyGoods($params = []) { // 请求参数 $p = [ @@ -357,7 +357,7 @@ class BuyService } // 规格 - $goods[0]['spec'] = $this->GoodsSpecificationsHandle($params); + $goods[0]['spec'] = self::GoodsSpecificationsHandle($params); // 获取商品基础信息 $goods_base = GoodsService::GoodsSpecDetail(['id'=>$goods[0]['goods_id'], 'spec'=>$goods[0]['spec']]); @@ -386,7 +386,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function BuyCart($params = []) + public static function BuyCart($params = []) { // 请求参数 $p = [ @@ -413,7 +413,7 @@ class BuyService 'g.is_shelves' => 1, 'c.id' => explode(',', $params['ids']), ]; - return $this->CartList($params); + return self::CartList($params); } /** @@ -424,7 +424,7 @@ class BuyService * @datetime 2018-10-12T00:42:49+0800 * @param [array] $params [输入参数] */ - public function BuyCartDelete($params = []) + public static function BuyCartDelete($params = []) { if(isset($params['buy_type']) && $params['buy_type'] == 'cart' && !empty($params['ids'])) { @@ -441,7 +441,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function BuyTypeGoodsList($params = []) + public static function BuyTypeGoodsList($params = []) { if(isset($params['buy_type'])) { @@ -476,7 +476,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function BuyGoodsCheck($params = []) + public static function BuyGoodsCheck($params = []) { // 请求参数 $p = [ @@ -551,7 +551,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function OrderAdd($params = []) + public static function OrderAdd($params = []) { // 请求参数 $p = [ @@ -581,12 +581,12 @@ class BuyService } // 清单商品 - $goods = $this->BuyTypeGoodsList($params); + $goods = self::BuyTypeGoodsList($params); if(!isset($goods['code']) || $goods['code'] != 0) { return $goods; } - $check = $this->BuyGoodsCheck(['goods'=>$goods['data']]); + $check = self::BuyGoodsCheck(['goods'=>$goods['data']]); if(!isset($check['code']) || $check['code'] != 0) { return $check; @@ -666,7 +666,7 @@ class BuyService // 库存扣除 if($order['status'] == 1) { - $ret = $this->OrderInventoryDeduct(['order_id'=>$order_id, 'order_data'=>$order]); + $ret = self::OrderInventoryDeduct(['order_id'=>$order_id, 'order_data'=>$order]); if($ret['code'] != 0) { // 事务回滚 @@ -680,7 +680,7 @@ class BuyService Db::commit(); // 删除购物车 - $this->BuyCartDelete($params); + self::BuyCartDelete($params); // 返回信息 $result = [ @@ -720,7 +720,7 @@ class BuyService * @desc description * @param [array] $where [条件] */ - public function CartTotal($where = []) + public static function CartTotal($where = []) { return (int) Db::name('Cart')->where($where)->count(); } @@ -734,7 +734,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function UserCartTotal($params = []) + public static function UserCartTotal($params = []) { // 请求参数 $p = [ @@ -749,7 +749,7 @@ class BuyService { return 0; } - return $this->CartTotal(['user_id'=>$params['user']['id']]); + return self::CartTotal(['user_id'=>$params['user']['id']]); } /** @@ -761,7 +761,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function OrderInventoryDeduct($params = []) + public static function OrderInventoryDeduct($params = []) { // 请求参数 $p = [ @@ -886,7 +886,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public function OrderInventoryRollback($params = []) + public static function OrderInventoryRollback($params = []) { // 请求参数 $p = [ diff --git a/application/service/ConfigService.php b/application/service/ConfigService.php index 66eb9b879..3a154b9bb 100755 --- a/application/service/ConfigService.php +++ b/application/service/ConfigService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\ResourcesService; +use app\service\ResourcesService; /** * 配置服务层 @@ -31,7 +31,7 @@ class ConfigService * @desc description * @param [array] $params [输入参数] */ - public function ConfigList($params = []) + public static function ConfigList($params = []) { $field = isset($params['field']) ? $params['field'] : 'only_tag,name,describe,value,error_tips'; return Db::name('Config')->column($field); @@ -45,7 +45,7 @@ class ConfigService * @datetime 2017-01-02T23:08:19+0800 * @param [array] $params [输入参数] */ - public function ConfigSave($params = []) + public static function ConfigSave($params = []) { // 参数校验 if(empty($params)) @@ -99,10 +99,10 @@ class ConfigService if($success > 0) { // 配置信息更新 - $this->ConfigInit(1); + self::ConfigInit(1); // 是否需要更新路由规则 - $ret = $this->RouteSeparatorHandle($params); + $ret = self::RouteSeparatorHandle($params); if($ret['code'] != 0) { return $ret; @@ -121,7 +121,7 @@ class ConfigService * @datetime 2017-01-03T21:36:55+0800 * @param [int] $status [是否更新数据,0否,1是] */ - public function ConfigInit($status = 0) + public static function ConfigInit($status = 0) { $key = config('shopxo.cache_common_my_config_key'); $data = cache($key); @@ -148,7 +148,7 @@ class ConfigService * @datetime 2017-01-02T23:08:19+0800 * @param [array] $params [输入参数] */ - public function RouteSeparatorHandle($params = []) + public static function RouteSeparatorHandle($params = []) { if(isset($params['home_seo_url_model'])) { diff --git a/application/service/CustomViewService.php b/application/service/CustomViewService.php index 923c1fa17..de34b24cd 100755 --- a/application/service/CustomViewService.php +++ b/application/service/CustomViewService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\ResourcesService; +use app\service\ResourcesService; /** * 自定义页面服务层 @@ -31,7 +31,7 @@ class CustomViewService * @desc description * @param [array] $params [输入参数] */ - public function CustomViewList($params = []) + public static function CustomViewList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? 'id,title,content,is_header,is_footer,is_full_screen,access_count,is_enable' : $params['field']; @@ -81,7 +81,7 @@ class CustomViewService * @desc description * @param [array] $where [条件] */ - public function CustomViewTotal($where = []) + public static function CustomViewTotal($where = []) { return (int) Db::name('CustomView')->where($where)->count(); } @@ -95,7 +95,7 @@ class CustomViewService * @desc description * @param [array] $params [输入参数] */ - public function CustomViewListWhere($params = []) + public static function CustomViewListWhere($params = []) { $where = []; @@ -149,7 +149,7 @@ class CustomViewService * @desc description * @param [array] $params [输入参数] */ - public function CustomViewAccessCountInc($params = []) + public static function CustomViewAccessCountInc($params = []) { if(!empty($params['id'])) { @@ -167,7 +167,7 @@ class CustomViewService * @desc description * @param [array] $params [输入参数] */ - public function CustomViewSave($params = []) + public static function CustomViewSave($params = []) { // 请求类型 $p = [ @@ -192,7 +192,7 @@ class CustomViewService // 数据 $content = ResourcesService::ContentStaticReplace($params['content'], 'add'); - $image = $this->MatchContentImage($content); + $image = self::MatchContentImage($content); $data = [ 'title' => $params['title'], 'content' => $content, @@ -231,7 +231,7 @@ class CustomViewService * @param [string] $content [文章内容] * @return [array] [文章图片数组(一维)] */ - private function MatchContentImage($content) + private static function MatchContentImage($content) { if(!empty($content)) { @@ -251,7 +251,7 @@ class CustomViewService * @desc description * @param [array] $params [输入参数] */ - public function CustomViewDelete($params = []) + public static function CustomViewDelete($params = []) { // 请求参数 $p = [ @@ -284,7 +284,7 @@ class CustomViewService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function CustomViewStatusUpdate($params = []) + public static function CustomViewStatusUpdate($params = []) { // 请求参数 $p = [ diff --git a/application/service/ExpressService.php b/application/service/ExpressService.php index 00823928c..3d8818c0b 100755 --- a/application/service/ExpressService.php +++ b/application/service/ExpressService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\ResourcesService; +use app\service\ResourcesService; /** * 快递服务层 @@ -31,7 +31,7 @@ class ExpressService * @desc description * @param [int] $express_id [快递id] */ - public function ExpressName($express_id = 0) + public static function ExpressName($express_id = 0) { return empty($express_id) ? null : Db::name('Express')->where(['id'=>intval($express_id)])->value('name'); } @@ -45,7 +45,7 @@ class ExpressService * @desc description * @param [array] $params [输入参数] */ - public function ExpressList($params = []) + public static function ExpressList($params = []) { $where = []; if(isset($params['is_enable'])) @@ -72,7 +72,7 @@ class ExpressService * @datetime 2018-12-16T23:54:46+0800 * @param [array] $params [输入参数] */ - public function ExpressNodeSon($params = []) + public static function ExpressNodeSon($params = []) { // id $id = isset($params['id']) ? intval($params['id']) : 0; @@ -103,7 +103,7 @@ class ExpressService * @datetime 2018-12-17T01:04:03+0800 * @param [array] $params [输入参数] */ - public function ExpressSave($params = []) + public static function ExpressSave($params = []) { // 请求参数 $p = [ @@ -164,7 +164,7 @@ class ExpressService * @datetime 2018-12-17T02:40:29+0800 * @param [array] $params [输入参数] */ - public function ExpressDelete($params = []) + public static function ExpressDelete($params = []) { // 请求参数 $p = [ diff --git a/application/service/GoodsService.php b/application/service/GoodsService.php index 73c2e98ac..9333979e2 100755 --- a/application/service/GoodsService.php +++ b/application/service/GoodsService.php @@ -11,9 +11,9 @@ namespace app\service; use think\Db; -use app\facade\ResourcesService; -use app\facade\BrandService; -use app\facade\RegionService; +use app\service\ResourcesService; +use app\service\BrandService; +use app\service\RegionService; /** * 商品服务层 @@ -33,14 +33,14 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function GoodsCategoryRow($params = []) + public static function GoodsCategoryRow($params = []) { if(empty($params['id'])) { return null; } $field = empty($params['field']) ? 'id,pid,icon,name,vice_name,describe,bg_color,big_images,sort,is_home_recommended' : $params['field']; - $data = $this->GoodsCategoryDataDealWith([Db::name('GoodsCategory')->field($field)->where(['is_enable'=>1, 'id'=>intval($params['id'])])->find()]); + $data = self::GoodsCategoryDataDealWith([Db::name('GoodsCategory')->field($field)->where(['is_enable'=>1, 'id'=>intval($params['id'])])->find()]); return empty($data[0]) ? null : $data[0]; } @@ -53,19 +53,19 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function GoodsCategory($params = []) + public static function GoodsCategory($params = []) { $where = empty($params['where']) ? ['pid'=>0, 'is_enable'=>1] : $params['where']; - $data = $this->GoodsCategoryList($where); + $data = self::GoodsCategoryList($where); if(!empty($data)) { foreach($data as &$v) { - $v['items'] = $this->GoodsCategoryList(['pid'=>$v['id'], 'is_enable'=>1]); + $v['items'] = self::GoodsCategoryList(['pid'=>$v['id'], 'is_enable'=>1]); if(!empty($v['items'])) { // 一次性查出所有二级下的三级、再做归类、避免sql连接超多 - $items = $this->GoodsCategoryList(['pid'=>array_column($v['items'], 'id'), 'is_enable'=>1]); + $items = self::GoodsCategoryList(['pid'=>array_column($v['items'], 'id'), 'is_enable'=>1]); if(!empty($items)) { foreach($v['items'] as &$vs) @@ -94,12 +94,12 @@ class GoodsService * @desc description * @param [array] $where [条件] */ - public function GoodsCategoryList($where = []) + public static function GoodsCategoryList($where = []) { $where['is_enable'] = 1; $field = 'id,pid,icon,name,vice_name,describe,bg_color,big_images,sort,is_home_recommended'; $data = Db::name('GoodsCategory')->field($field)->where($where)->order('sort asc')->select(); - return $this->GoodsCategoryDataDealWith($data); + return self::GoodsCategoryDataDealWith($data); } /** @@ -111,7 +111,7 @@ class GoodsService * @desc description * @param [array] $data [商品分类数据 二维数组] */ - private function GoodsCategoryDataDealWith($data) + private static function GoodsCategoryDataDealWith($data) { if(!empty($data) && is_array($data)) { @@ -143,17 +143,17 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function HomeFloorList($params = []) + public static function HomeFloorList($params = []) { // 商品大分类 $params['where'] = ['pid'=>0, 'is_home_recommended'=>1]; - $goods_category = $this->GoodsCategory($params); + $goods_category = self::GoodsCategory($params); if(!empty($goods_category)) { foreach($goods_category as &$v) { - $category_ids = $this->GoodsCategoryItemsIds([$v['id']], 1); - $v['goods'] = $this->CategoryGoodsList(['where'=>['gci.category_id'=>$category_ids, 'is_home_recommended'=>1], 'm'=>0, 'n'=>6, 'field'=>'g.id,g.title,g.title_color,g.images,g.home_recommended_images,g.original_price,g.price,g.min_price,g.max_price,g.inventory,g.buy_min_number,g.buy_max_number']); + $category_ids = self::GoodsCategoryItemsIds([$v['id']], 1); + $v['goods'] = self::CategoryGoodsList(['where'=>['gci.category_id'=>$category_ids, 'is_home_recommended'=>1], 'm'=>0, 'n'=>6, 'field'=>'g.id,g.title,g.title_color,g.images,g.home_recommended_images,g.original_price,g.price,g.min_price,g.max_price,g.inventory,g.buy_min_number,g.buy_max_number']); } } return $goods_category; @@ -169,7 +169,7 @@ class GoodsService * @param [array] $ids [分类id数组] * @param [int] $is_enable [是否启用 null, 0否, 1是] */ - public function GoodsCategoryItemsIds($ids = [], $is_enable = null) + public static function GoodsCategoryItemsIds($ids = [], $is_enable = null) { $where = ['pid'=>$ids]; if($is_enable !== null) @@ -179,7 +179,7 @@ class GoodsService $data = Db::name('GoodsCategory')->where($where)->column('id'); if(!empty($data)) { - $temp = $this->GoodsCategoryItemsIds($data, $is_enable); + $temp = self::GoodsCategoryItemsIds($data, $is_enable); if(!empty($temp)) { $data = array_merge($data, $temp); @@ -197,7 +197,7 @@ class GoodsService * @desc description * @param array $where [条件] */ - public function CategoryGoodsTotal($where = []) + public static function CategoryGoodsTotal($where = []) { return (int) Db::name('Goods')->alias('g')->join(['__GOODS_CATEGORY_JOIN__'=>'gci'], 'g.id=gci.goods_id')->where($where)->count('DISTINCT g.id'); } @@ -211,7 +211,7 @@ class GoodsService * @desc description * @param array $params [输入参数: where, field, is_photo] */ - public function CategoryGoodsList($params = []) + public static function CategoryGoodsList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? 'g.*' : $params['field']; @@ -221,7 +221,7 @@ class GoodsService $n = isset($params['n']) ? intval($params['n']) : 10; $data = Db::name('Goods')->alias('g')->join(['__GOODS_CATEGORY_JOIN__'=>'gci'], 'g.id=gci.goods_id')->field($field)->where($where)->group('g.id')->order($order_by)->limit($m, $n)->select(); - return $this->GoodsDataHandle($params, $data); + return self::GoodsDataHandle($params, $data); } /** @@ -233,7 +233,7 @@ class GoodsService * @param [array] $params [输入参数] * @param [array] $data [商品列表] */ - public function GoodsDataHandle($params, $data) + public static function GoodsDataHandle($params, $data) { if(!empty($data)) { @@ -320,13 +320,13 @@ class GoodsService // 获取规格 if($is_spec && !empty($v['id'])) { - $v['specifications'] = $this->GoodsSpecifications(['goods_id'=>$v['id']]); + $v['specifications'] = self::GoodsSpecifications(['goods_id'=>$v['id']]); } // 获取app内容 if($is_content_app && !empty($v['id'])) { - $v['content_app'] = $this->GoodsContentApp(['goods_id'=>$v['id']]); + $v['content_app'] = self::GoodsContentApp(['goods_id'=>$v['id']]); } } } @@ -343,7 +343,7 @@ class GoodsService * @param [array] $params [输入参数] * @return [array] [app内容] */ - public function GoodsContentApp($params = []) + public static function GoodsContentApp($params = []) { $data = Db::name('GoodsContentApp')->where(['goods_id'=>$params['goods_id']])->field('id,images,content')->order('sort asc')->select(); if(!empty($data)) @@ -368,7 +368,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function GoodsSpecifications($params = []) + public static function GoodsSpecifications($params = []) { // 条件 $where = ['goods_id'=>$params['goods_id']]; @@ -401,7 +401,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function GoodsFavor($params = []) + public static function GoodsFavor($params = []) { // 请求参数 $p = [ @@ -434,7 +434,7 @@ class GoodsService return DataReturn('收藏成功', 0, [ 'text' => '已收藏', 'status' => 1, - 'count' => $this->GoodsFavorTotal(['goods_id'=>$data['goods_id']]), + 'count' => self::GoodsFavorTotal(['goods_id'=>$data['goods_id']]), ]); } else { return DataReturn('收藏失败'); @@ -446,7 +446,7 @@ class GoodsService return DataReturn('收藏成功', 0, [ 'text' => '已收藏', 'status' => 1, - 'count' => $this->GoodsFavorTotal(['goods_id'=>$data['goods_id']]), + 'count' => self::GoodsFavorTotal(['goods_id'=>$data['goods_id']]), ]); } @@ -456,7 +456,7 @@ class GoodsService return DataReturn('取消成功', 0, [ 'text' => '收藏', 'status' => 0, - 'count' => $this->GoodsFavorTotal(['goods_id'=>$data['goods_id']]), + 'count' => self::GoodsFavorTotal(['goods_id'=>$data['goods_id']]), ]); } else { return DataReturn('取消失败'); @@ -474,7 +474,7 @@ class GoodsService * @param [array] $params [输入参数] * @return [int] [1已收藏, 0未收藏] */ - public function IsUserGoodsFavor($params = []) + public static function IsUserGoodsFavor($params = []) { // 请求参数 $p = [ @@ -509,7 +509,7 @@ class GoodsService * @desc description * @param [array] $where [条件] */ - public function GoodsCommentsTotal($goods_id) + public static function GoodsCommentsTotal($goods_id) { return (int) Db::name('OrderComments')->where(['goods_id'=>intval($goods_id)])->count(); } @@ -523,7 +523,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function UserGoodsFavorListWhere($params = []) + public static function UserGoodsFavorListWhere($params = []) { $where = [ ['g.is_delete_time', '=', 0] @@ -552,7 +552,7 @@ class GoodsService * @desc description * @param [array] $where [条件] */ - public function GoodsFavorTotal($where = []) + public static function GoodsFavorTotal($where = []) { return (int) Db::name('GoodsFavor')->alias('f')->join(['__GOODS__'=>'g'], 'g.id=f.goods_id')->where($where)->count(); } @@ -566,7 +566,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function GoodsFavorList($params = []) + public static function GoodsFavorList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $m = isset($params['m']) ? intval($params['m']) : 0; @@ -599,7 +599,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function GoodsAccessCountInc($params = []) + public static function GoodsAccessCountInc($params = []) { if(!empty($params['goods_id'])) { @@ -617,7 +617,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function GoodsBrowseSave($params = []) + public static function GoodsBrowseSave($params = []) { // 请求参数 $p = [ @@ -669,7 +669,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function UserGoodsBrowseListWhere($params = []) + public static function UserGoodsBrowseListWhere($params = []) { $where = [ ['g.is_delete_time', '=', 0] @@ -698,7 +698,7 @@ class GoodsService * @desc description * @param [array] $where [条件] */ - public function GoodsBrowseTotal($where = []) + public static function GoodsBrowseTotal($where = []) { return (int) Db::name('GoodsBrowse')->alias('b')->join(['__GOODS__'=>'g'], 'g.id=b.goods_id')->where($where)->count(); } @@ -712,7 +712,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function GoodsBrowseList($params = []) + public static function GoodsBrowseList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $m = isset($params['m']) ? intval($params['m']) : 0; @@ -743,7 +743,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function GoodsBrowseDelete($params = []) + public static function GoodsBrowseDelete($params = []) { // 请求参数 $p = [ @@ -785,7 +785,7 @@ class GoodsService * @desc description * @param [array] $where [条件] */ - public function GoodsTotal($where = []) + public static function GoodsTotal($where = []) { return (int) Db::name('Goods')->where($where)->count(); } @@ -799,7 +799,7 @@ class GoodsService * @desc description * @param array $params [输入参数: where, field, is_photo] */ - public function GoodsList($params = []) + public static function GoodsList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? '*' : $params['field']; @@ -809,7 +809,7 @@ class GoodsService $n = isset($params['n']) ? intval($params['n']) : 10; $data = Db::name('Goods')->field($field)->where($where)->order($order_by)->limit($m, $n)->select(); - return $this->GoodsDataHandle($params, $data); + return self::GoodsDataHandle($params, $data); } /** @@ -820,7 +820,7 @@ class GoodsService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $params [输入参数] */ - public function GetAdminIndexWhere($params = []) + public static function GetAdminIndexWhere($params = []) { $where = [ ['is_delete_time', '=', 0], @@ -866,7 +866,7 @@ class GoodsService * @datetime 2018-12-10T01:02:11+0800 * @param [array] $params [输入参数] */ - public function GoodsSave($params = []) + public static function GoodsSave($params = []) { // 请求参数 $p = [ @@ -907,21 +907,21 @@ class GoodsService } // 规格 - $specifications = $this->GetFormGoodsSpecificationsParams($params); + $specifications = self::GetFormGoodsSpecificationsParams($params); if($specifications['code'] != 0) { return $specifications; } // 相册 - $photo = $this->GetFormGoodsPhotoParams($params); + $photo = self::GetFormGoodsPhotoParams($params); if($photo['code'] != 0) { return $photo; } // 手机端详情 - $content_app = $this->GetFormGoodsContentAppParams($params); + $content_app = self::GetFormGoodsContentAppParams($params); if($content_app['code'] != 0) { return $content_app; @@ -977,7 +977,7 @@ class GoodsService if(isset($goods_id) && $goods_id > 0) { // 分类 - $ret = $this->GoodsCategoryInsert(explode(',', $params['category_id']), $goods_id); + $ret = self::GoodsCategoryInsert(explode(',', $params['category_id']), $goods_id); if($ret['code'] != 0) { // 回滚事务 @@ -986,7 +986,7 @@ class GoodsService } // 规格 - $ret = $this->GoodsSpecificationsInsert($specifications['data'], $goods_id); + $ret = self::GoodsSpecificationsInsert($specifications['data'], $goods_id); if($ret['code'] != 0) { // 回滚事务 @@ -994,7 +994,7 @@ class GoodsService return $ret; } else { // 更新商品基础信息 - $ret = $this->GoodsSaveBaseUpdate($params, $goods_id); + $ret = self::GoodsSaveBaseUpdate($params, $goods_id); if($ret['code'] != 0) { // 回滚事务 @@ -1004,7 +1004,7 @@ class GoodsService } // 相册 - $ret = $this->GoodsPhotoInsert($photo['data'], $goods_id); + $ret = self::GoodsPhotoInsert($photo['data'], $goods_id); if($ret['code'] != 0) { // 回滚事务 @@ -1013,7 +1013,7 @@ class GoodsService } // 手机详情 - $ret = $this->GoodsContentAppInsert($content_app['data'], $goods_id); + $ret = self::GoodsContentAppInsert($content_app['data'], $goods_id); if($ret['code'] != 0) { // 回滚事务 @@ -1046,7 +1046,7 @@ class GoodsService * @param [array] $params [输入参数] * @param [int] $goods_id [商品id] */ - private function GoodsSaveBaseUpdate($params, $goods_id) + private static function GoodsSaveBaseUpdate($params, $goods_id) { $data = Db::name('GoodsSpecBase')->field('min(price) AS min_price, max(price) AS max_price, sum(inventory) AS inventory, min(original_price) AS min_original_price, max(original_price) AS max_original_price')->where(['goods_id'=>$goods_id])->find(); if(empty($data)) @@ -1078,7 +1078,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - private function GetFormGoodsSpecificationsParams($params = []) + private static function GetFormGoodsSpecificationsParams($params = []) { $data = []; $title = []; @@ -1215,7 +1215,7 @@ class GoodsService * @param [array] $params [输入参数] * @return [array] [一维数组但图片地址] */ - private function GetFormGoodsPhotoParams($params = []) + private static function GetFormGoodsPhotoParams($params = []) { if(empty($params['photo'])) { @@ -1242,7 +1242,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - private function GetFormGoodsContentAppParams($params = []) + private static function GetFormGoodsContentAppParams($params = []) { // 开始处理 $result = []; @@ -1276,7 +1276,7 @@ class GoodsService * @param [int] $goods_id [商品id] * @return [array] [boolean | msg] */ - private function GoodsCategoryInsert($data, $goods_id) + private static function GoodsCategoryInsert($data, $goods_id) { Db::name('GoodsCategoryJoin')->where(['goods_id'=>$goods_id])->delete(); if(!empty($data)) @@ -1308,7 +1308,7 @@ class GoodsService * @param [int] $goods_id [商品id] * @return [array] [boolean | msg] */ - private function GoodsContentAppInsert($data, $goods_id) + private static function GoodsContentAppInsert($data, $goods_id) { Db::name('GoodsContentApp')->where(['goods_id'=>$goods_id])->delete(); if(!empty($data)) @@ -1342,7 +1342,7 @@ class GoodsService * @param [int] $goods_id [商品id] * @return [array] [boolean | msg] */ - private function GoodsPhotoInsert($data, $goods_id) + private static function GoodsPhotoInsert($data, $goods_id) { Db::name('GoodsPhoto')->where(['goods_id'=>$goods_id])->delete(); if(!empty($data)) @@ -1376,7 +1376,7 @@ class GoodsService * @param [int] $goods_id [商品id] * @return [array] [boolean | msg] */ - private function GoodsSpecificationsInsert($data, $goods_id) + private static function GoodsSpecificationsInsert($data, $goods_id) { // 删除原来的数据 Db::name('GoodsSpecType')->where(['goods_id'=>$goods_id])->delete(); @@ -1488,7 +1488,7 @@ class GoodsService * @datetime 2018-12-07T00:24:14+0800 * @param [array] $params [输入参数] */ - public function GoodsDelete($params = []) + public static function GoodsDelete($params = []) { // 参数是否有误 if(empty($params['id'])) @@ -1550,7 +1550,7 @@ class GoodsService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function GoodsStatusUpdate($params = []) + public static function GoodsStatusUpdate($params = []) { // 请求参数 $p = [ @@ -1594,7 +1594,7 @@ class GoodsService * @desc description * @param [int] $goods_id [商品id] */ - public function GoodsEditSpecifications($goods_id) + public static function GoodsEditSpecifications($goods_id) { $where = ['goods_id'=>$goods_id]; @@ -1678,7 +1678,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function GoodsSpecDetail($params = []) + public static function GoodsSpecDetail($params = []) { // 请求参数 $p = [ @@ -1779,7 +1779,7 @@ class GoodsService * @desc description * @param [array] $params [输入参数] */ - public function GoodsSpecType($params = []) + public static function GoodsSpecType($params = []) { // 请求参数 $p = [ @@ -1865,7 +1865,7 @@ class GoodsService * @datetime 2018-12-16T23:54:46+0800 * @param [array] $params [输入参数] */ - public function GoodsCategoryNodeSon($params = []) + public static function GoodsCategoryNodeSon($params = []) { // id $id = isset($params['id']) ? intval($params['id']) : 0; @@ -1897,7 +1897,7 @@ class GoodsService * @datetime 2018-12-17T01:04:03+0800 * @param [array] $params [输入参数] */ - public function GoodsCategorySave($params = []) + public static function GoodsCategorySave($params = []) { // 请求参数 $p = [ @@ -1977,7 +1977,7 @@ class GoodsService * @datetime 2018-12-17T02:40:29+0800 * @param [array] $params [输入参数] */ - public function GoodsCategoryDelete($params = []) + public static function GoodsCategoryDelete($params = []) { // 请求参数 $p = [ @@ -1999,7 +1999,7 @@ class GoodsService } // 获取分类下所有分类id - $ids = $this->GoodsCategoryItemsIds([$params['id']]); + $ids = self::GoodsCategoryItemsIds([$params['id']]); $ids[] = $params['id']; // 开始删除 diff --git a/application/service/IntegralService.php b/application/service/IntegralService.php index 47efec88a..18618548b 100755 --- a/application/service/IntegralService.php +++ b/application/service/IntegralService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\MessageService; +use app\service\MessageService; /** * 积分服务层 @@ -36,7 +36,7 @@ class IntegralService * @param [int] $operation_id [操作人员id] * @return [boolean] [成功true, 失败false] */ - public function UserIntegralLogAdd($user_id, $original_integral, $new_integral, $msg = '', $type = 0, $operation_id = 0) + public static function UserIntegralLogAdd($user_id, $original_integral, $new_integral, $msg = '', $type = 0, $operation_id = 0) { $data = array( 'user_id' => intval($user_id), @@ -67,7 +67,7 @@ class IntegralService * @desc description * @param [array] $params [输入参数] */ - public function UserIntegralLogListWhere($params = []) + public static function UserIntegralLogListWhere($params = []) { // 条件初始化 $where = []; @@ -114,7 +114,7 @@ class IntegralService * @desc description * @param [array] $where [条件] */ - public function UserIntegralLogTotal($where = []) + public static function UserIntegralLogTotal($where = []) { return (int) Db::name('UserIntegralLog')->where($where)->count(); } @@ -128,7 +128,7 @@ class IntegralService * @desc description * @param [array] $params [输入参数] */ - public function UserIntegralLogList($params = []) + public static function UserIntegralLogList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $m = isset($params['m']) ? intval($params['m']) : 0; @@ -162,7 +162,7 @@ class IntegralService * @desc description * @param [array] $params [输入参数] */ - public function OrderGoodsIntegralGiving($params = []) + public static function OrderGoodsIntegralGiving($params = []) { // 请求参数 $p = [ @@ -230,7 +230,7 @@ class IntegralService * @desc description * @param [array] $params [输入参数] */ - public function AdminIntegralList($params = []) + public static function AdminIntegralList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $m = isset($params['m']) ? intval($params['m']) : 0; @@ -269,7 +269,7 @@ class IntegralService * @desc description * @param [array] $where [条件] */ - public function AdminIntegralTotal($where = []) + public static function AdminIntegralTotal($where = []) { return (int) Db::name('UserIntegralLog')->alias('ui')->join(['__USER__'=>'u'], 'u.id=ui.user_id')->where($where)->count(); } @@ -283,7 +283,7 @@ class IntegralService * @desc description * @param [array] $params [输入参数] */ - public function AdminIntegralListWhere($params = []) + public static function AdminIntegralListWhere($params = []) { $where = []; diff --git a/application/service/LinkService.php b/application/service/LinkService.php index 3bebe6a55..504815712 100755 --- a/application/service/LinkService.php +++ b/application/service/LinkService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\GoodsService; +use app\service\GoodsService; /** * 友情链接服务层 @@ -31,7 +31,7 @@ class LinkService * @desc description * @param [array] $params [输入参数] */ - public function LinkList($params = []) + public static function LinkList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $data = Db::name('Link')->where($where)->order('sort asc')->select(); @@ -47,7 +47,7 @@ class LinkService * @desc description * @param [array] $params [输入参数] */ - public function LinkSave($params = []) + public static function LinkSave($params = []) { // 请求类型 $p = [ @@ -131,7 +131,7 @@ class LinkService * @desc description * @param [array] $params [输入参数] */ - public function LinkDelete($params = []) + public static function LinkDelete($params = []) { // 请求参数 $p = [ @@ -164,7 +164,7 @@ class LinkService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function LinkStatusUpdate($params = []) + public static function LinkStatusUpdate($params = []) { // 请求参数 $p = [ diff --git a/application/service/MessageService.php b/application/service/MessageService.php index 4dbc6383a..349c5226b 100755 --- a/application/service/MessageService.php +++ b/application/service/MessageService.php @@ -36,7 +36,7 @@ class MessageService * @param [int] $type [类型(默认0 普通消息)] * @return [boolean] [成功true, 失败false] */ - public function MessageAdd($user_id, $title, $detail, $business_type = 0, $business_id = 0, $type = 0) + public static function MessageAdd($user_id, $title, $detail, $business_type = 0, $business_id = 0, $type = 0) { $data = array( 'title' => $title, @@ -60,7 +60,7 @@ class MessageService * @desc description * @param [array] $params [输入参数] */ - public function MessageListWhere($params = []) + public static function MessageListWhere($params = []) { // 条件初始化 $where = [ @@ -124,7 +124,7 @@ class MessageService * @desc description * @param [array] $where [条件] */ - public function MessageTotal($where = []) + public static function MessageTotal($where = []) { return (int) Db::name('Message')->where($where)->count(); } @@ -138,7 +138,7 @@ class MessageService * @desc description * @param [array] $params [输入参数] */ - public function UserMessageTotal($params = []) + public static function UserMessageTotal($params = []) { // 请求参数 $p = [ @@ -153,7 +153,7 @@ class MessageService { return 0; } - return $this->MessageTotal($this->MessageListWhere($params)); + return self::MessageTotal(self::MessageListWhere($params)); } /** @@ -165,7 +165,7 @@ class MessageService * @desc description * @param [array] $params [输入参数] */ - public function MessageList($params = []) + public static function MessageList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $m = isset($params['m']) ? intval($params['m']) : 0; @@ -207,7 +207,7 @@ class MessageService * @desc description * @param [array] $params [输入参数] */ - public function MessageRead($params = []) + public static function MessageRead($params = []) { // 请求参数 $p = [ @@ -238,7 +238,7 @@ class MessageService * @desc description * @param [array] $params [输入参数] */ - public function AdminMessageList($params = []) + public static function AdminMessageList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $m = isset($params['m']) ? intval($params['m']) : 0; @@ -285,7 +285,7 @@ class MessageService * @desc description * @param [array] $where [条件] */ - public function AdminMessageTotal($where = []) + public static function AdminMessageTotal($where = []) { return (int) Db::name('Message')->alias('m')->join(['__USER__'=>'u'], 'u.id=m.user_id')->where($where)->count(); } @@ -299,7 +299,7 @@ class MessageService * @desc description * @param [array] $params [输入参数] */ - public function AdminMessageListWhere($params = []) + public static function AdminMessageListWhere($params = []) { $where = [ ['m.is_delete_time', '=', 0], @@ -354,7 +354,7 @@ class MessageService * @desc description * @param [array] $params [输入参数] */ - public function MessageDelete($params = []) + public static function MessageDelete($params = []) { // 请求参数 $p = [ diff --git a/application/service/NavigationService.php b/application/service/NavigationService.php index 4315749fd..7007929ca 100755 --- a/application/service/NavigationService.php +++ b/application/service/NavigationService.php @@ -30,7 +30,7 @@ class NavigationService * @desc description * @param [array] $params [输入参数] */ - public function Home($params = []) + public static function Home($params = []) { // 读取缓存数据 $header = cache(config('shopxo.cache_common_home_nav_header_key')); @@ -42,12 +42,12 @@ class NavigationService // 缓存没数据则从数据库重新读取,顶部菜单 if(empty($header)) { - $header = $this->NavDataDealWith(Db::name('Navigation')->field($field)->where(array('nav_type'=>'header', 'is_show'=>1, 'pid'=>0))->order('sort')->select()); + $header = self::NavDataDealWith(Db::name('Navigation')->field($field)->where(array('nav_type'=>'header', 'is_show'=>1, 'pid'=>0))->order('sort')->select()); if(!empty($header)) { foreach($header as &$v) { - $v['items'] = $this->NavDataDealWith(Db::name('Navigation')->field($field)->where(array('nav_type'=>'header', 'is_show'=>1, 'pid'=>$v['id']))->order('sort')->select()); + $v['items'] = self::NavDataDealWith(Db::name('Navigation')->field($field)->where(array('nav_type'=>'header', 'is_show'=>1, 'pid'=>$v['id']))->order('sort')->select()); } } cache(config('shopxo.cache_common_home_nav_header_key'), $header); @@ -56,7 +56,7 @@ class NavigationService // 底部导航 if(empty($footer)) { - $footer = $this->NavDataDealWith(Db::name('Navigation')->field($field)->where(array('nav_type'=>'footer', 'is_show'=>1))->order('sort')->select()); + $footer = self::NavDataDealWith(Db::name('Navigation')->field($field)->where(array('nav_type'=>'footer', 'is_show'=>1))->order('sort')->select()); cache(config('shopxo.cache_common_home_nav_footer_key'), $footer); } @@ -75,7 +75,7 @@ class NavigationService * @param [array] $data [需要处理的数据] * @return [array] [处理好的数据] */ - public function NavDataDealWith($data) + public static function NavDataDealWith($data) { if(!empty($data) && is_array($data)) { @@ -114,7 +114,7 @@ class NavigationService * @desc description * @param [array] $params [输入参数] */ - public function NavList($params = []) + public static function NavList($params = []) { if(empty($params['nav_type'])) { @@ -122,12 +122,12 @@ class NavigationService } $field = 'id,pid,name,url,value,data_type,sort,is_show,is_new_window_open'; - $data = $this->NavDataDealWith(Db::name('Navigation')->field($field)->where(['nav_type'=>$params['nav_type'], 'pid'=>0])->order('sort')->select()); + $data = self::NavDataDealWith(Db::name('Navigation')->field($field)->where(['nav_type'=>$params['nav_type'], 'pid'=>0])->order('sort')->select()); if(!empty($data)) { foreach($data as &$v) { - $v['items'] = $this->NavDataDealWith(Db::name('Navigation')->field($field)->where(['nav_type'=>$params['nav_type'], 'pid'=>$v['id']])->order('sort')->select()); + $v['items'] = self::NavDataDealWith(Db::name('Navigation')->field($field)->where(['nav_type'=>$params['nav_type'], 'pid'=>$v['id']])->order('sort')->select()); } } return $data; @@ -142,7 +142,7 @@ class NavigationService * @desc description * @param [array] $params [输入参数] */ - public function LevelOneNav($params = []) + public static function LevelOneNav($params = []) { if(empty($params['nav_type'])) { @@ -160,7 +160,7 @@ class NavigationService * @datetime 2016-12-07T21:58:19+0800 * @param [array] $params [输入参数] */ - public function NavSave($params = []) + public static function NavSave($params = []) { if(empty($params['data_type'])) { @@ -281,7 +281,7 @@ class NavigationService } // 保存数据 - return $this->NacDataSave($params); + return self::NacDataSave($params); } /** @@ -292,7 +292,7 @@ class NavigationService * @datetime 2017-02-05T20:12:30+0800 * @param [array] $params [输入参数] */ - public function NacDataSave($params = []) + public static function NacDataSave($params = []) { // 非自定义导航数据处理 if(empty($params['name'])) @@ -370,7 +370,7 @@ class NavigationService * @desc description * @param [array] $params [输入参数] */ - public function NavDelete($params = []) + public static function NavDelete($params = []) { // 请求参数 $p = [ @@ -416,7 +416,7 @@ class NavigationService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function NavStatusUpdate($params = []) + public static function NavStatusUpdate($params = []) { // 请求参数 $p = [ diff --git a/application/service/OrderService.php b/application/service/OrderService.php index f5b998485..42773a65a 100755 --- a/application/service/OrderService.php +++ b/application/service/OrderService.php @@ -11,14 +11,13 @@ namespace app\service; use think\Db; -use app\facade\GoodsService; -use app\facade\PaymentService; -use app\facade\BuyService; -use app\facade\IntegralService; -use app\facade\RegionService; -use app\facade\ExpressService; -use app\facade\ResourcesService; -use app\facade\MessageService; +use app\service\GoodsService; +use app\service\PaymentService; +use app\service\BuyService; +use app\service\IntegralService; +use app\service\RegionService; +use app\service\ExpressService; +use app\service\ResourcesService; /** * 订单服务层 @@ -38,7 +37,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function Pay($params = []) + public static function Pay($params = []) { // 请求参数 $p = [ @@ -123,7 +122,7 @@ class OrderService { // 非线上支付处理 $params['user']['user_name_view'] = '用户-'.$params['user']['user_name_view']; - $pay_result = $this->OrderPaymentUnderLine([ + $pay_result = self::OrderPaymentUnderLine([ 'order' => $order, 'payment' => $payment[0], 'user' => $params['user'], @@ -157,7 +156,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function AdminPay($params = []) + public static function AdminPay($params = []) { // 请求参数 $p = [ @@ -204,7 +203,7 @@ class OrderService } // 非线上支付处理 - return $this->OrderPaymentUnderLine([ + return self::OrderPaymentUnderLine([ 'order' => $order, 'payment' => $payment[0], 'user' => $params['user'], @@ -220,7 +219,7 @@ class OrderService * @datetime 2018-10-05T22:40:57+0800 * @param [array] $params [输入参数] */ - private function OrderPaymentUnderLine($params = []) + private static function OrderPaymentUnderLine($params = []) { if(!empty($params['order']) && !empty($params['payment']) && !empty($params['user'])) { @@ -237,7 +236,7 @@ class OrderService 'pay_price' => $params['order']['total_price'], ], ]; - return $this->OrderPayHandle($pay_params); + return self::OrderPayHandle($pay_params); } } return DataReturn('无需处理', 0); @@ -252,7 +251,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function Respond($params = []) + public static function Respond($params = []) { // 请求参数 $p = [ @@ -294,7 +293,7 @@ class OrderService $order = Db::name('Order')->where($where)->find(); // 非线上支付处理 - $this->OrderPaymentUnderLine([ + self::OrderPaymentUnderLine([ 'order' => $order, 'payment' => $payment[0], 'user' => $params['user'], @@ -313,7 +312,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function Notify($params = []) + public static function Notify($params = []) { // 支付方式 $payment = PaymentService::PaymentList(['where'=>['payment'=>PAYMENT_TYPE]]); @@ -345,7 +344,7 @@ class OrderService 'pay_price' => $ret['data']['pay_price'], ], ]; - return $this->OrderPayHandle($pay_params); + return self::OrderPayHandle($pay_params); } /** @@ -356,7 +355,7 @@ class OrderService * @datetime 2018-10-05T23:02:14+0800 * @param [array] $params [输入参数] */ - private function OrderPayHandle($params = []) + private static function OrderPayHandle($params = []) { // 订单信息 if(empty($params['order'])) @@ -413,7 +412,7 @@ class OrderService if(Db::name('Order')->where(['id'=>$params['order']['id']])->update($upd_data)) { // 添加状态日志 - if($this->OrderHistoryAdd($params['order']['id'], 2, $params['order']['status'], '支付', 0, '系统')) + if(self::OrderHistoryAdd($params['order']['id'], 2, $params['order']['status'], '支付', 0, '系统')) { // 库存扣除 $ret = BuyService::OrderInventoryDeduct(['order_id'=>$params['order']['id'], 'order_data'=>$upd_data]); @@ -446,7 +445,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function OrderListWhere($params = []) + public static function OrderListWhere($params = []) { // 用户类型 $user_type = isset($params['user_type']) ? $params['user_type'] : 'user'; @@ -549,7 +548,7 @@ class OrderService * @desc description * @param [array] $where [条件] */ - public function OrderTotal($where = []) + public static function OrderTotal($where = []) { return (int) Db::name('Order')->where($where)->count(); } @@ -563,7 +562,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function OrderList($params = []) + public static function OrderList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $m = isset($params['m']) ? intval($params['m']) : 0; @@ -676,7 +675,7 @@ class OrderService * @param [string] $creator_name [操作人名称] * @return [boolean] [成功 true, 失败 false] */ - public function OrderHistoryAdd($order_id, $new_status, $original_status, $msg = '', $creator = 0, $creator_name = '') + public static function OrderHistoryAdd($order_id, $new_status, $original_status, $msg = '', $creator = 0, $creator_name = '') { // 状态描述 $order_status_list = lang('common_order_user_status'); @@ -706,7 +705,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function OrderCancel($params = []) + public static function OrderCancel($params = []) { // 请求参数 $p = [ @@ -764,7 +763,7 @@ class OrderService // 订单状态日志 $creator = isset($params['creator']) ? intval($params['creator']) : 0; $creator_name = isset($params['creator_name']) ? htmlentities($params['creator_name']) : ''; - $this->OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '取消', $creator, $creator_name); + self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '取消', $creator, $creator_name); // 提交事务 Db::commit(); @@ -785,7 +784,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function OrderDelivery($params = []) + public static function OrderDelivery($params = []) { // 请求参数 $p = [ @@ -855,7 +854,7 @@ class OrderService // 订单状态日志 $creator = isset($params['creator']) ? intval($params['creator']) : 0; $creator_name = isset($params['creator_name']) ? htmlentities($params['creator_name']) : ''; - $this->OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '收货', $creator, $creator_name); + self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '收货', $creator, $creator_name); // 提交事务 Db::commit(); @@ -876,7 +875,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function OrderCollect($params = []) + public static function OrderCollect($params = []) { // 请求参数 $p = [ @@ -931,7 +930,7 @@ class OrderService } // 订单商品销量增加 - $ret = $this->GoodsSalesCountInc(['order_id'=>$order['id']]); + $ret = self::GoodsSalesCountInc(['order_id'=>$order['id']]); if($ret['code'] != 0) { // 事务回滚 @@ -945,7 +944,7 @@ class OrderService // 订单状态日志 $creator = isset($params['creator']) ? intval($params['creator']) : 0; $creator_name = isset($params['creator_name']) ? htmlentities($params['creator_name']) : ''; - $this->OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '收货', $creator, $creator_name); + self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '收货', $creator, $creator_name); // 提交事务 Db::commit(); @@ -966,7 +965,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function OrderConfirm($params = []) + public static function OrderConfirm($params = []) { // 请求参数 $p = [ @@ -1026,7 +1025,7 @@ class OrderService // 订单状态日志 $creator = isset($params['creator']) ? intval($params['creator']) : 0; $creator_name = isset($params['creator_name']) ? htmlentities($params['creator_name']) : ''; - $this->OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '确认', $creator, $creator_name); + self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '确认', $creator, $creator_name); // 事务提交 Db::commit(); @@ -1047,7 +1046,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function OrderDelete($params = []) + public static function OrderDelete($params = []) { // 请求参数 $p = [ @@ -1125,7 +1124,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function Comments($params = []) + public static function Comments($params = []) { // 请求参数 $p = [ @@ -1234,7 +1233,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function OrderStatusStepTotal($params = []) + public static function OrderStatusStepTotal($params = []) { // 状态数据封装 $result = []; @@ -1328,7 +1327,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function GoodsSalesCountInc($params = []) + public static function GoodsSalesCountInc($params = []) { // 请求参数 $p = [ @@ -1370,7 +1369,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public function OrderPayCheck($params = []) + public static function OrderPayCheck($params = []) { // 请求参数 $p = [ diff --git a/application/service/PayLogService.php b/application/service/PayLogService.php index 7fa2f84b3..a34ff97fe 100755 --- a/application/service/PayLogService.php +++ b/application/service/PayLogService.php @@ -29,7 +29,7 @@ class PayLogService * @datetime 2018-12-23T02:22:03+0800 * @param [array] $params [输入参数] */ - public function PayLogTypeList($params = []) + public static function PayLogTypeList($params = []) { $data = Db::name('PayLog')->field('payment AS id, payment_name AS name')->group('payment')->select(); return DataReturn('处理成功', 0, $data); @@ -43,7 +43,7 @@ class PayLogService * @desc description * @param [array] $params [输入参数] */ - public function AdminPayLogList($params = []) + public static function AdminPayLogList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $m = isset($params['m']) ? intval($params['m']) : 0; @@ -82,7 +82,7 @@ class PayLogService * @desc description * @param [array] $where [条件] */ - public function AdminPayLogTotal($where = []) + public static function AdminPayLogTotal($where = []) { return (int) Db::name('PayLog')->alias('p')->join(['__USER__'=>'u'], 'u.id=p.user_id')->where($where)->count(); } @@ -96,7 +96,7 @@ class PayLogService * @desc description * @param [array] $params [输入参数] */ - public function AdminPayLogListWhere($params = []) + public static function AdminPayLogListWhere($params = []) { $where = []; @@ -145,7 +145,7 @@ class PayLogService * @desc description * @param [array] $params [输入参数] */ - public function PayLogDelete($params = []) + public static function PayLogDelete($params = []) { // 请求参数 $p = [ diff --git a/application/service/PaymentService.php b/application/service/PaymentService.php index 89b857b3a..75edc43ae 100755 --- a/application/service/PaymentService.php +++ b/application/service/PaymentService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\ResourcesService; +use app\service\ResourcesService; /** * 支付方式服务层 @@ -23,16 +23,16 @@ use app\facade\ResourcesService; class PaymentService { // 插件目录 - public $payment_dir; + public static $payment_dir; // 支付业务类型 - public $payment_business_type_all; + public static $payment_business_type_all; // 不删除的支付方式 - public $cannot_deleted_list; + public static $cannot_deleted_list; // 入口文件位置 - public $dir_root_path; + public static $dir_root_path; /** * 初始化 @@ -43,19 +43,19 @@ class PaymentService * @desc description * @param [array] $params [输入参数] */ - private function Init($params = []) + private static function Init($params = []) { // 插件目录 - $this->payment_dir = ROOT.'extend'.DS.'payment'.DS; + self::$payment_dir = ROOT.'extend'.DS.'payment'.DS; // 支付业务类型 - $this->payment_business_type_all = config('shopxo.payment_business_type_all'); + self::$payment_business_type_all = config('shopxo.payment_business_type_all'); // 不删除的支付方式 - $this->cannot_deleted_list = config('shopxo.payment_cannot_deleted_list'); + self::$cannot_deleted_list = ['DeliveryPayment', 'CashPayment']; // 入口文件位置 - $this->dir_root_path = defined('IS_ROOT_ACCESS') ? ROOT : ROOT.'public'.DS; + self::$dir_root_path = defined('IS_ROOT_ACCESS') ? ROOT : ROOT.'public'.DS; } /** @@ -66,16 +66,16 @@ class PaymentService * @date 2018-09-17 * @desc description */ - public function PlugPaymentList() + public static function PlugPaymentList() { // 初始化 - $this->Init(); + self::Init(); // 开始处理 $data = []; - if(is_dir($this->payment_dir)) + if(is_dir(self::$payment_dir)) { - if($dh = opendir($this->payment_dir)) + if($dh = opendir(self::$payment_dir)) { while(($temp_file = readdir($dh)) !== false) { @@ -83,16 +83,16 @@ class PaymentService { // 获取模块配置信息 $payment = htmlentities(str_replace('.php', '', $temp_file)); - $config = $this->GetPaymentConfig($payment); + $config = self::GetPaymentConfig($payment); if($config !== false) { // 数据组装 - $temp = $this->DataAnalysis($config); + $temp = self::DataAnalysis($config); $temp['id'] = date('YmdHis').GetNumberCode(8); $temp['payment'] = $payment; // 获取数据库配置信息 - $db_config = $this->PaymentList(['where'=>['payment'=>$payment]]); + $db_config = self::PaymentList(['where'=>['payment'=>$payment]]); if(!empty($db_config[0])) { $temp['is_install'] = 1; @@ -123,7 +123,7 @@ class PaymentService * @desc description * @param [string] $payment [模块名称] */ - private function GetPaymentConfig($payment) + private static function GetPaymentConfig($payment) { $payment = '\payment\\'.$payment; if(class_exists($payment)) @@ -146,7 +146,7 @@ class PaymentService * @desc description * @param [array] $data [插件配置信息] */ - private function DataAnalysis($data) + private static function DataAnalysis($data) { return [ 'name' => isset($data['base']['name']) ? htmlentities($data['base']['name']) : $payment, @@ -175,7 +175,7 @@ class PaymentService * @desc description * @param [array] $params [输入参数] */ - public function PaymentList($params = []) + public static function PaymentList($params = []) { $where = empty($params['where']) ? [] : $params['where']; if(isset($params['is_enable'])) @@ -211,9 +211,9 @@ class PaymentService * @desc 下订单根据终端自动筛选支付方式 * @param [array] $params [输入参数] */ - public function BuyPaymentList($params = []) + public static function BuyPaymentList($params = []) { - $data = $this->PaymentList($params); + $data = self::PaymentList($params); $result = []; if(!empty($data)) @@ -239,7 +239,7 @@ class PaymentService * @desc description * @param [int] $order_id [订单id] */ - public function OrderPaymentName($order_id = 0) + public static function OrderPaymentName($order_id = 0) { return empty($order_id) ? null : Db::name('PayLog')->where(['order_id'=>intval($order_id)])->value('payment_name'); } @@ -253,7 +253,7 @@ class PaymentService * @desc description * @param [array] $params [输入参数] */ - public function PaymentUpdate($params = []) + public static function PaymentUpdate($params = []) { // 请求类型 $p = [ @@ -295,7 +295,7 @@ class PaymentService 'name' => $params['name'], 'apply_terminal' => empty($params['apply_terminal']) ? '' : json_encode(explode(',', $params['apply_terminal'])), 'logo' => $attachment['data']['logo'], - 'config' => json_encode($this->GetPlugConfig($params)), + 'config' => json_encode(self::GetPlugConfig($params)), 'sort' => intval($params['sort']), 'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0, 'is_open_user' => isset($params['is_open_user']) ? intval($params['is_open_user']) : 0, @@ -317,7 +317,7 @@ class PaymentService * @desc description * @param [array] $params [输入参数] */ - private function GetPlugConfig($params = []) + private static function GetPlugConfig($params = []) { $data = []; foreach($params as $k=>$v) @@ -338,7 +338,7 @@ class PaymentService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function PaymentStatusUpdate($params = []) + public static function PaymentStatusUpdate($params = []) { // 请求参数 $p = [ @@ -380,18 +380,18 @@ class PaymentService * @version 1.0.0 * @datetime 2018-09-29T00:01:49+0800 */ - private function PowerCheck() + private static function PowerCheck() { // 入口文件目录 - if(!is_writable($this->dir_root_path)) + if(!is_writable(self::$dir_root_path)) { - return DataReturn('目录没有操作权限'.'['.$this->dir_root_path.']', -3); + return DataReturn('目录没有操作权限'.'['.self::$dir_root_path.']', -3); } // 插件权限 - if(!is_writable($this->payment_dir)) + if(!is_writable(self::$payment_dir)) { - return DataReturn('目录没有操作权限'.'['.$this->payment_dir.']', -3); + return DataReturn('目录没有操作权限'.'['.self::$payment_dir.']', -3); } } @@ -404,13 +404,13 @@ class PaymentService * @desc description * @param [array] $params [输入参数] */ - public function Upload($params = []) + public static function Upload($params = []) { // 初始化 - $this->Init(); + self::Init(); // 权限 - $ret = $this->PowerCheck(); + $ret = self::PowerCheck(); if($ret['code'] != 0) { return $ret; @@ -431,7 +431,7 @@ class PaymentService } // 是否已有存在插件 - if(file_exists($this->payment_dir.$_FILES['file']['name'])) + if(file_exists(self::$payment_dir.$_FILES['file']['name'])) { return DataReturn('已存在相同插件', -3); } @@ -441,14 +441,14 @@ class PaymentService $payment = str_replace(array('.', '/', '\\', ':'), '', $name); // 存储文件 - $file = $this->payment_dir.$payment.'.php'; + $file = self::$payment_dir.$payment.'.php'; if(!move_uploaded_file($_FILES['file']['tmp_name'], $file)) { return DataReturn('上传失败', -100); } // 文件校验 - $config = $this->GetPaymentConfig($payment); + $config = self::GetPaymentConfig($payment); if($config === false) { @unlink($file); @@ -466,10 +466,10 @@ class PaymentService * @desc description * @param [array] $params [输入参数] */ - public function Install($params = []) + public static function Install($params = []) { // 初始化 - $this->Init(); + self::Init(); // 参数 if(empty($params['id'])) @@ -479,10 +479,10 @@ class PaymentService // 数据处理 $payment = $params['id']; - $config = $this->GetPaymentConfig($payment); + $config = self::GetPaymentConfig($payment); if($config !== false) { - $data = $this->DataAnalysis($config); + $data = self::DataAnalysis($config); $data['payment'] = $payment; $data['element'] = empty($data['element']) ? '' : json_encode($data['element']); $data['apply_terminal'] = empty($data['apply_terminal']) ? '' : json_encode($data['apply_terminal']); @@ -497,7 +497,7 @@ class PaymentService if(Db::name('Payment')->insertGetId($data) > 0) { // 入口文件生成 - $ret = $this->PaymentEntranceCreated($payment); + $ret = self::PaymentEntranceCreated($payment); if($ret['code'] == 'code') { // 提交事务 @@ -528,13 +528,13 @@ class PaymentService * @desc description * @param [array] $params [输入参数] */ - public function Delete($params = []) + public static function Delete($params = []) { // 初始化 - $this->Init(); + self::Init(); // 权限 - $ret = $this->PowerCheck(); + $ret = self::PowerCheck(); if($ret['code'] != 0) { return $ret; @@ -548,13 +548,13 @@ class PaymentService // 是否禁止删除 $payment = $params['id']; - if(in_array($payment, $this->cannot_deleted_list)) + if(in_array($payment, self::$cannot_deleted_list)) { return DataReturn('该支付方式禁止删除', -10); } // 是否存在 - $file = $this->payment_dir.$payment.'.php'; + $file = self::$payment_dir.$payment.'.php'; if(!file_exists($file)) { return DataReturn('资源不存在或已被删除', -2); @@ -573,7 +573,7 @@ class PaymentService } // 删除入口文件 - $this->PaymentEntranceDelete($payment); + self::PaymentEntranceDelete($payment); return DataReturn('删除成功'); } @@ -587,7 +587,7 @@ class PaymentService * @desc description * @param [array] $params [输入参数] */ - public function Uninstall($params = []) + public static function Uninstall($params = []) { // 参数 if(empty($params['id'])) @@ -596,14 +596,14 @@ class PaymentService } // 初始化 - $this->Init(); + self::Init(); // 开始卸载 $payment = $params['id']; if(db('Payment')->where(['payment'=>$payment])->delete()) { // 删除入口文件 - $this->PaymentEntranceDelete($payment); + self::PaymentEntranceDelete($payment); return DataReturn('卸载成功', 0); } @@ -618,17 +618,17 @@ class PaymentService * @datetime 2018-09-28T23:38:52+0800 * @param [string] $payment [支付唯一标记] */ - private function PaymentEntranceCreated($payment) + private static function PaymentEntranceCreated($payment) { // 权限 - $ret = $this->PowerCheck(); + $ret = self::PowerCheck(); if($ret['code'] != 0) { return $ret; } // 批量创建 - foreach($this->payment_business_type_all as $v) + foreach(self::$payment_business_type_all as $v) { $name = strtolower($v['name']); @@ -719,12 +719,12 @@ require __DIR__.'/index.php'; php; } - @file_put_contents($this->dir_root_path.'payment_'.$name.'_'.strtolower($payment).'_respond.php', $respond); + @file_put_contents(self::$dir_root_path.'payment_'.$name.'_'.strtolower($payment).'_respond.php', $respond); // 线下支付不生成异步入口文件 if(!in_array($payment, config('shopxo.under_line_list'))) { - @file_put_contents($this->dir_root_path.'payment_'.$name.'_'.strtolower($payment).'_notify.php', $notify); + @file_put_contents(self::$dir_root_path.'payment_'.$name.'_'.strtolower($payment).'_notify.php', $notify); } } @@ -739,26 +739,26 @@ php; * @datetime 2018-09-28T23:38:52+0800 * @param [string] $payment [支付唯一标记] */ - private function PaymentEntranceDelete($payment) + private static function PaymentEntranceDelete($payment) { // 权限 - $ret = $this->PowerCheck(); + $ret = self::PowerCheck(); if($ret['code'] != 0) { return $ret; } $payment = strtolower($payment); - foreach($this->payment_business_type_all as $v) + foreach(self::$payment_business_type_all as $v) { $name = strtolower($v['name']); - if(file_exists($this->dir_root_path.'payment_'.$name.'_'.$payment.'_notify.php')) + if(file_exists(self::$dir_root_path.'payment_'.$name.'_'.$payment.'_notify.php')) { - @unlink($this->dir_root_path.'payment_'.$name.'_'.$payment.'_notify.php'); + @unlink(self::$dir_root_path.'payment_'.$name.'_'.$payment.'_notify.php'); } - if(file_exists($this->dir_root_path.'payment_'.$name.'_'.$payment.'_respond.php')) + if(file_exists(self::$dir_root_path.'payment_'.$name.'_'.$payment.'_respond.php')) { - @unlink($this->dir_root_path.'payment_'.$name.'_'.$payment.'_respond.php'); + @unlink(self::$dir_root_path.'payment_'.$name.'_'.$payment.'_respond.php'); } } @@ -775,10 +775,10 @@ php; * @param [string] $payment [支付标记] * @param [string] $name [支付业务方式名称] */ - public function EntranceFileChecked($payment, $name) + public static function EntranceFileChecked($payment, $name) { // 同步返回文件 - if(!file_exists($this->dir_root_path.'payment_'.strtolower($name).'_'.strtolower($payment).'_respond.php')) + if(!file_exists(self::$dir_root_path.'payment_'.strtolower($name).'_'.strtolower($payment).'_respond.php')) { return DataReturn('支付返回入口文件不存在,请联系管理员处理', -10); } @@ -786,7 +786,7 @@ php; // 线下支付不生成异步入口文件 if(!in_array($payment, config('shopxo.under_line_list'))) { - if(!file_exists($this->dir_root_path.'payment_'.strtolower($name).'_'.strtolower($payment).'_notify.php')) + if(!file_exists(self::$dir_root_path.'payment_'.strtolower($name).'_'.strtolower($payment).'_notify.php')) { return DataReturn('支付通知入口文件不存在,请联系管理员处理', -10); } diff --git a/application/service/RegionService.php b/application/service/RegionService.php index 8ebfaa2fc..ee07e78a6 100755 --- a/application/service/RegionService.php +++ b/application/service/RegionService.php @@ -30,7 +30,7 @@ class RegionService * @desc description * @param [int] $region_id [地区id] */ - public function RegionName($region_id = 0) + public static function RegionName($region_id = 0) { return empty($region_id) ? null : Db::name('Region')->where(['id'=>intval($region_id)])->value('name'); } @@ -43,7 +43,7 @@ class RegionService * @datetime 2018-12-09T00:13:02+0800 * @param [array] $param [输入参数] */ - public function RegionItems($param = []) + public static function RegionItems($param = []) { $pid = isset($param['pid']) ? intval($param['pid']) : 0; return Db::name('Region')->where(['pid'=>$pid, 'is_enable'=>1])->select(); @@ -58,7 +58,7 @@ class RegionService * @desc description * @param [array] $params [输入参数] */ - public function RegionNode($params = []) + public static function RegionNode($params = []) { $field = empty($params['field']) ? 'id,name,level,letters' : $params['field']; $where = empty($params['where']) ? [] : $params['where']; @@ -75,7 +75,7 @@ class RegionService * @datetime 2018-12-16T23:54:46+0800 * @param [array] $params [输入参数] */ - public function RegionNodeSon($params = []) + public static function RegionNodeSon($params = []) { // id $id = isset($params['id']) ? intval($params['id']) : 0; @@ -105,7 +105,7 @@ class RegionService * @datetime 2018-12-17T01:04:03+0800 * @param [array] $params [输入参数] */ - public function RegionSave($params = []) + public static function RegionSave($params = []) { // 请求参数 $p = [ @@ -157,7 +157,7 @@ class RegionService * @datetime 2018-12-17T02:40:29+0800 * @param [array] $params [输入参数] */ - public function RegionDelete($params = []) + public static function RegionDelete($params = []) { // 请求参数 $p = [ diff --git a/application/service/ResourcesService.php b/application/service/ResourcesService.php index bf4188e8e..adcca4c93 100755 --- a/application/service/ResourcesService.php +++ b/application/service/ResourcesService.php @@ -31,7 +31,7 @@ class ResourcesService * @param [string] $type [操作类型[get读取额你让, add写入内容](编辑/展示传入get,数据写入数据库传入add)] * @return [string] [正确返回替换后的内容, 则返回原内容] */ - public function ContentStaticReplace($content, $type = 'get') + public static function ContentStaticReplace($content, $type = 'get') { switch($type) { @@ -56,7 +56,7 @@ class ResourcesService * @desc description * @param [string] $value [附件路径地址] */ - public function AttachmentPathHandle($value) + public static function AttachmentPathHandle($value) { return empty($value) ? '' : str_replace([__MY_PUBLIC_URL__, __MY_ROOT_PUBLIC__], DS, $value); } @@ -71,14 +71,14 @@ class ResourcesService * @param [array] $params [输入参数] * @param [array] $data [字段列表] */ - public function AttachmentParams($params, $data) + public static function AttachmentParams($params, $data) { $result = []; if(!empty($data)) { foreach($data as $field) { - $result[$field] = isset($params[$field]) ? $this->AttachmentPathHandle($params[$field]) : ''; + $result[$field] = isset($params[$field]) ? self::AttachmentPathHandle($params[$field]) : ''; } } @@ -93,7 +93,7 @@ class ResourcesService * @datetime 2019-01-13T15:13:30+0800 * @param [type] $value [description] */ - public function AttachmentPathViewHandle($value) + public static function AttachmentPathViewHandle($value) { if(!empty($value)) { diff --git a/application/service/SafetyService.php b/application/service/SafetyService.php index d33997a88..823d766a1 100755 --- a/application/service/SafetyService.php +++ b/application/service/SafetyService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\UserService; +use app\service\UserService; /** * 安全服务层 @@ -30,7 +30,7 @@ class SafetyService * @datetime 2017-03-28T10:38:23+0800 * @param [array] $params [输入参数] */ - public function LoginPwdUpdate($params = []) + public static function LoginPwdUpdate($params = []) { // 数据验证 $p = [ @@ -104,7 +104,7 @@ class SafetyService * @param [string] $accounts [帐号, 手机|邮箱] * @param [string] $type [帐号类型, sms|email] */ - private function IsExistAccounts($accounts, $type) + private static function IsExistAccounts($accounts, $type) { $field = ($type == 'sms') ? 'mobile' : 'email'; $user = Db::name('User')->where([$field=>$accounts])->value('id'); @@ -126,7 +126,7 @@ class SafetyService * @param [array] $verify_params [配置参数] * @return [object] [图片验证码类对象] */ - private function IsImaVerify($params, $verify_params) + private static function IsImaVerify($params, $verify_params) { if(MyC('home_img_verify_state') == 1) { @@ -156,7 +156,7 @@ class SafetyService * @datetime 2017-03-05T19:17:10+0800 * @param [array] $params [输入参数] */ - public function VerifySend($params = []) + public static function VerifySend($params = []) { // 数据验证 $p = [ @@ -185,7 +185,7 @@ class SafetyService $accounts = $params['accounts']; // 帐号是否已存在 - $ret = $this->IsExistAccounts($accounts, $params['type']); + $ret = self::IsExistAccounts($accounts, $params['type']); if($ret['code'] != 0) { return $ret; @@ -200,7 +200,7 @@ class SafetyService ); // 是否开启图片验证码 - $verify = $this->IsImaVerify($params, $img_verify_params); + $verify = self::IsImaVerify($params, $img_verify_params); if($verify['code'] != 0) { return $verify; @@ -250,7 +250,7 @@ class SafetyService * @datetime 2017-03-28T15:57:19+0800 * @param [array] $params [输入参数] */ - public function VerifyCheck($params = []) + public static function VerifyCheck($params = []) { // 数据验证 $p = [ @@ -322,7 +322,7 @@ class SafetyService * @datetime 2017-03-28T17:04:36+0800 * @param [array] $params [输入参数] */ - public function AccountsUpdate($params = []) + public static function AccountsUpdate($params = []) { // 数据验证 $p = [ @@ -354,7 +354,7 @@ class SafetyService } // 帐号是否已存在 - $ret = $this->IsExistAccounts($params['accounts'], $params['type']); + $ret = self::IsExistAccounts($params['accounts'], $params['type']); if($ret['code'] != 0) { return $ret; diff --git a/application/service/ScreeningPriceService.php b/application/service/ScreeningPriceService.php index 045d5fb93..dbe9477be 100755 --- a/application/service/ScreeningPriceService.php +++ b/application/service/ScreeningPriceService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\ResourcesService; +use app\service\ResourcesService; /** * 筛选价格服务层 @@ -30,7 +30,7 @@ class ScreeningPriceService * @datetime 2018-12-16T23:54:46+0800 * @param [array] $params [输入参数] */ - public function ScreeningPriceNodeSon($params = []) + public static function ScreeningPriceNodeSon($params = []) { // id $id = isset($params['id']) ? intval($params['id']) : 0; @@ -60,7 +60,7 @@ class ScreeningPriceService * @datetime 2018-12-17T01:04:03+0800 * @param [array] $params [输入参数] */ - public function ScreeningPriceSave($params = []) + public static function ScreeningPriceSave($params = []) { // 请求参数 $p = [ @@ -114,7 +114,7 @@ class ScreeningPriceService * @datetime 2018-12-17T02:40:29+0800 * @param [array] $params [输入参数] */ - public function ScreeningPriceDelete($params = []) + public static function ScreeningPriceDelete($params = []) { // 请求参数 $p = [ diff --git a/application/service/SearchService.php b/application/service/SearchService.php index 949f98d8e..8fff4a5d5 100755 --- a/application/service/SearchService.php +++ b/application/service/SearchService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\GoodsService; +use app\service\GoodsService; /** * 搜索服务层 @@ -31,7 +31,7 @@ class SearchService * @desc description * @param [array] $params [输入参数] */ - public function GoodsCategoryList($params = []) + public static function GoodsCategoryList($params = []) { return GoodsService::GoodsCategoryList(['pid'=>$params['category_id']]); } @@ -45,7 +45,7 @@ class SearchService * @desc description * @param [array] $params [输入参数] */ - public function ScreeningPriceList($params = []) + public static function ScreeningPriceList($params = []) { $field = empty($params['field']) ? '*' : $params['field']; return Db::name('ScreeningPrice')->field($field)->where(['is_enable'=>1])->order('sort asc')->select(); @@ -60,7 +60,7 @@ class SearchService * @desc description * @param [array] $params [输入参数] */ - public function GoodsList($params = []) + public static function GoodsList($params = []) { $result = [ 'page_total' => 0, @@ -144,7 +144,7 @@ class SearchService * @datetime 2018-10-21T00:37:44+0800 * @param [array] $params [输入参数] */ - public function SearchAdd($params = []) + public static function SearchAdd($params = []) { // 筛选价格 $screening_price = ''; @@ -180,7 +180,7 @@ class SearchService * @datetime 2018-10-20T23:55:06+0800 * @param [array] $params [输入参数] */ - public function SearchKeywordsList($params = []) + public static function SearchKeywordsList($params = []) { $where = [ ['keywords', '<>', ''], diff --git a/application/service/SlideService.php b/application/service/SlideService.php index cf5a732a0..776538d42 100755 --- a/application/service/SlideService.php +++ b/application/service/SlideService.php @@ -11,7 +11,7 @@ namespace app\service; use think\Db; -use app\facade\ResourcesService; +use app\service\ResourcesService; /** * 轮播图服务层 @@ -31,7 +31,7 @@ class SlideService * @desc description * @param [array] $params [输入参数] */ - public function SlideList($params = []) + public static function SlideList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? '*' : $params['field']; @@ -96,7 +96,7 @@ class SlideService * @desc description * @param [array] $where [条件] */ - public function SlideTotal($where = []) + public static function SlideTotal($where = []) { return (int) Db::name('Slide')->where($where)->count(); } @@ -110,7 +110,7 @@ class SlideService * @desc description * @param [array] $params [输入参数] */ - public function SlideListWhere($params = []) + public static function SlideListWhere($params = []) { $where = []; @@ -158,7 +158,7 @@ class SlideService * @desc description * @param [array] $params [输入参数] */ - public function SlideSave($params = []) + public static function SlideSave($params = []) { // 请求类型 $p = [ @@ -249,7 +249,7 @@ class SlideService * @desc description * @param [array] $params [输入参数] */ - public function SlideDelete($params = []) + public static function SlideDelete($params = []) { // 请求参数 $p = [ @@ -282,7 +282,7 @@ class SlideService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function SlideStatusUpdate($params = []) + public static function SlideStatusUpdate($params = []) { // 请求参数 $p = [ diff --git a/application/service/ThemeService.php b/application/service/ThemeService.php index 672da9261..41389eb95 100755 --- a/application/service/ThemeService.php +++ b/application/service/ThemeService.php @@ -22,8 +22,8 @@ use think\Db; class ThemeService { // 静态目录和html目录 - private $html_path = 'application'.DS.'index'.DS.'view'.DS; - private $static_path = 'public'.DS.'static'.DS.'index'.DS; + private static $html_path = 'application'.DS.'index'.DS.'view'.DS; + private static $static_path = 'public'.DS.'static'.DS.'index'.DS; /** * 获取模板列表 @@ -34,10 +34,10 @@ class ThemeService * @param [array] $params [输入参数] * @return [array] [模板列表] */ - public function ThemeList($params = []) + public static function ThemeList($params = []) { $result = []; - $dir = ROOT.$this->html_path; + $dir = ROOT.self::$html_path; if(is_dir($dir)) { if($dh = opendir($dir)) @@ -64,7 +64,7 @@ class ThemeService { continue; } - $preview = ROOT.$this->static_path.$temp_file.DS.'images'.DS.'preview.jpg'; + $preview = ROOT.self::$static_path.$temp_file.DS.'images'.DS.'preview.jpg'; $result[] = array( 'theme' => $temp_file, 'name' => htmlentities($data['name']), @@ -90,7 +90,7 @@ class ThemeService * @datetime 2018-12-19T00:53:45+0800 * @param [array] $params [输入参数] */ - public function ThemeUpload($params = []) + public static function ThemeUpload($params = []) { // 文件上传校验 $error = FileUploadError('theme'); @@ -107,11 +107,11 @@ class ThemeService } // 目录是否有权限 - if(!is_writable(ROOT.$this->html_path)) + if(!is_writable(ROOT.self::$html_path)) { return DataReturn('视图目录没权限', -10); } - if(!is_writable(ROOT.$this->static_path)) + if(!is_writable(ROOT.self::$static_path)) { return DataReturn('资源目录没权限', -10); } @@ -131,10 +131,10 @@ class ThemeService // 拼接路径 if(strpos($file, '_html') !== false) { - $file = ROOT.$this->html_path.$file; + $file = ROOT.self::$html_path.$file; } else if(strpos($file, '_static') !== false) { - $file = ROOT.$this->static_path.$file; + $file = ROOT.self::$static_path.$file; } else { continue; } @@ -173,7 +173,7 @@ class ThemeService * @datetime 2018-12-19T00:46:02+0800 * @param [array] $params [输入参数] */ - public function ThemeDelete($params = []) + public static function ThemeDelete($params = []) { if(empty($params['id'])) { @@ -202,7 +202,7 @@ class ThemeService } // 开始删除主题 - if(\base\FileUtil::UnlinkDir(ROOT.$this->html_path.$id) && \base\FileUtil::UnlinkDir(ROOT.$this->static_path.$id)) + if(\base\FileUtil::UnlinkDir(ROOT.self::$html_path.$id) && \base\FileUtil::UnlinkDir(ROOT.self::$static_path.$id)) { return DataReturn('删除成功'); } diff --git a/application/service/UserService.php b/application/service/UserService.php index 02e15766b..8823bc1b9 100755 --- a/application/service/UserService.php +++ b/application/service/UserService.php @@ -11,8 +11,7 @@ namespace app\service; use think\Db; -use app\facade\RegionService; -use app\facade\ResourcesService; +use app\service\RegionService; /** * 用户服务层 @@ -31,7 +30,7 @@ class UserService * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public function UserList($params = []) + public static function UserList($params = []) { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? '*' : $params['field']; @@ -79,7 +78,7 @@ class UserService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $params [输入参数] */ - public function UserListWhere($params = []) + public static function UserListWhere($params = []) { $where = []; if(!empty($params['keywords'])) @@ -117,7 +116,7 @@ class UserService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $where [条件] */ - public function UserTotal($where) + public static function UserTotal($where) { return (int) Db::name('User')->where($where)->count(); } @@ -130,7 +129,7 @@ class UserService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $params [输入参数] */ - public function UserSave($params = []) + public static function UserSave($params = []) { // 请求参数 $p = [ @@ -261,7 +260,7 @@ class UserService * @datetime 2016-12-10T22:16:29+0800 * @param [array] $params [输入参数] */ - public function UserDelete($params = []) + public static function UserDelete($params = []) { // 请求参数 $p = [ @@ -294,7 +293,7 @@ class UserService * @desc description * @param [array] $params [输入参数] */ - public function UserAddressList($params = []) + public static function UserAddressList($params = []) { // 请求参数 $p = [ @@ -337,7 +336,7 @@ class UserService * @datetime 2018-09-23T23:19:25+0800 * @param [array] $params [输入参数] */ - public function UserAddressRow($params = []) + public static function UserAddressRow($params = []) { // 请求参数 $p = [ @@ -362,7 +361,7 @@ class UserService $params['where'] = [ 'id' => intval($params['id']), ]; - $ret = $this->UserAddressList($params); + $ret = self::UserAddressList($params); if(!empty($ret['data'][0])) { $ret['data'] = $ret['data'][0]; @@ -379,7 +378,7 @@ class UserService * @desc description * @param [array] $params [输入参数] */ - public function UserDefaultAddress($params = []) + public static function UserDefaultAddress($params = []) { // 请求参数 $p = [ @@ -397,7 +396,7 @@ class UserService // 获取用户地址 $params['where'] = ['is_default'=>1]; - $ret = $this->UserAddressList($params); + $ret = self::UserAddressList($params); if(!empty($ret['data'][0])) { $ret['data'] = $ret['data'][0]; @@ -413,7 +412,7 @@ class UserService * @datetime 2018-09-23T22:28:31+0800 * @param [array] $params [输入参数] */ - public function UserAddressSave($params = []) + public static function UserAddressSave($params = []) { // 请求参数 $p = [ @@ -531,7 +530,7 @@ class UserService * @datetime 2018-09-23T23:55:51+0800 * @param [array] $params [输入参数] */ - public function UserAddressDelete($params = []) + public static function UserAddressDelete($params = []) { // 请求参数 $p = [ @@ -572,7 +571,7 @@ class UserService * @desc description * @param [array] $params [输入参数] */ - public function UserAddressDefault($params = []) + public static function UserAddressDefault($params = []) { // 请求参数 $p = [ @@ -621,7 +620,7 @@ class UserService * @param [boolean] $is_app [是否为app] * @return [boolean] [记录成功true, 失败false] */ - public function UserLoginRecord($user_id = 0, $is_app = false) + public static function UserLoginRecord($user_id = 0, $is_app = false) { if(!empty($user_id)) { @@ -681,7 +680,7 @@ class UserService * @desc description * @param [array] $params [输入参数] */ - public function UserAvatarUpload($params = []) + public static function UserAvatarUpload($params = []) { // 请求参数 $p = [ @@ -756,7 +755,7 @@ class UserService ]; if(Db::name('User')->where(['id'=>$params['user']['id']])->update($data)) { - $this->UserLoginRecord($params['user']['id']); + self::UserLoginRecord($params['user']['id']); return DataReturn('上传成功', 0); } return DataReturn('上传失败', -100); @@ -771,7 +770,7 @@ class UserService * @desc description * @param [array] $params [输入参数] */ - public function Login($params = []) + public static function Login($params = []) { // 是否开启用户登录 if(MyC('home_user_login_state') != 1) @@ -821,7 +820,7 @@ class UserService if(Db::name('User')->where(array('id'=>$user['id']))->update($data) !== false) { // 登录记录 - if($this->UserLoginRecord($user['id'])) + if(self::UserLoginRecord($user['id'])) { return DataReturn('登录成功', 0); } @@ -838,7 +837,7 @@ class UserService * @desc description * @param [array] $params [输入参数] */ - public function Reg($params = []) + public static function Reg($params = []) { // 数据验证 $p = [ @@ -876,7 +875,7 @@ class UserService } // 账户校验 - $ret = $this->UserRegAccountsCheck($params); + $ret = self::UserRegAccountsCheck($params); if($ret['code'] != 0) { return $ret; @@ -925,7 +924,7 @@ class UserService // 清除验证码 $obj->Remove(); - if($this->UserLoginRecord($user_id)) + if(self::UserLoginRecord($user_id)) { return DataReturn('注册成功', 0); } @@ -942,7 +941,7 @@ class UserService * @datetime 2017-03-10T10:06:29+0800 * @param [array] $params [输入参数] */ - private function UserRegAccountsCheck($params = []) + private static function UserRegAccountsCheck($params = []) { // 参数 $type = $params['type']; @@ -962,7 +961,7 @@ class UserService } // 手机号码是否已存在 - if($this->IsExistAccounts($accounts, 'mobile')) + if(self::IsExistAccounts($accounts, 'mobile')) { return DataReturn('手机号码已存在', -3); } @@ -976,7 +975,7 @@ class UserService } // 电子邮箱是否已存在 - if($this->IsExistAccounts($accounts, 'email')) + if(self::IsExistAccounts($accounts, 'email')) { return DataReturn('电子邮箱已存在', -3); } @@ -994,7 +993,7 @@ class UserService * @param [string] $field [字段名称] * @return [boolean] [存在true, 不存在false] */ - private function IsExistAccounts($accounts, $field = 'mobile') + private static function IsExistAccounts($accounts, $field = 'mobile') { $id = Db::name('User')->where(array($field=>$accounts))->value('id'); return !empty($id); @@ -1010,7 +1009,7 @@ class UserService * @param [array] $verify_params [配置参数] * @return [object] [图片验证码类对象] */ - private function IsImaVerify($params, $verify_params) + private static function IsImaVerify($params, $verify_params) { if(MyC('home_img_verify_state') == 1) { @@ -1040,7 +1039,7 @@ class UserService * @datetime 2017-03-10T10:06:29+0800 * @param [array] $params [输入参数] */ - public function RegVerifySend($params = []) + public static function RegVerifySend($params = []) { // 数据验证 $p = [ @@ -1068,7 +1067,7 @@ class UserService } // 账户校验 - $ret = $this->UserRegAccountsCheck($params); + $ret = self::UserRegAccountsCheck($params); if($ret['code'] != 0) { return $ret; @@ -1082,7 +1081,7 @@ class UserService ); // 是否开启图片验证码 - $verify = $this->IsImaVerify($params, $verify_params); + $verify = self::IsImaVerify($params, $verify_params); if($verify['code'] != 0) { return $verify; @@ -1128,7 +1127,7 @@ class UserService * @datetime 2017-03-10T17:35:03+0800 * @param [array] $params [输入参数] */ - public function ForgetPwdVerifySend($params = []) + public static function ForgetPwdVerifySend($params = []) { // 参数 if(empty($params['accounts'])) @@ -1137,7 +1136,7 @@ class UserService } // 账户是否存在 - $ret = $this->UserForgetAccountsCheck($params['accounts']); + $ret = self::UserForgetAccountsCheck($params['accounts']); if($ret['code'] != 0) { return $ret; @@ -1151,7 +1150,7 @@ class UserService ); // 是否开启图片验证码 - $verify = $this->IsImaVerify($params, $verify_params); + $verify = self::IsImaVerify($params, $verify_params); if($verify['code'] != 0) { return $verify; @@ -1205,18 +1204,18 @@ class UserService * @param [string] $accounts [账户名称] * @return [string] [账户字段 mobile, email] */ - private function UserForgetAccountsCheck($accounts) + private static function UserForgetAccountsCheck($accounts) { if(CheckMobile($accounts)) { - if(!$this->IsExistAccounts($accounts, 'mobile')) + if(!self::IsExistAccounts($accounts, 'mobile')) { return DataReturn('手机号码不存在', -3); } return DataReturn('操作成功', 0, 'mobile'); } else if(CheckEmail($accounts)) { - if(!$this->IsExistAccounts($accounts, 'email')) + if(!self::IsExistAccounts($accounts, 'email')) { return DataReturn('电子邮箱不存在', -3); } @@ -1233,7 +1232,7 @@ class UserService * @datetime 2017-03-10T17:35:03+0800 * @param [array] $params [输入参数] */ - public function ForgetPwd($params = []) + public static function ForgetPwd($params = []) { // 数据验证 $p = [ @@ -1260,7 +1259,7 @@ class UserService } // 账户是否存在 - $ret = $this->UserForgetAccountsCheck($params['accounts']); + $ret = self::UserForgetAccountsCheck($params['accounts']); if($ret['code'] != 0) { return $ret; @@ -1313,7 +1312,7 @@ class UserService * @desc description * @param [array] $params [输入参数] */ - public function PersonalSave($params = []) + public static function PersonalSave($params = []) { // 数据验证 $p = [ @@ -1355,7 +1354,7 @@ class UserService if(Db::name('User')->where(array('id'=>$params['user']['id']))->update($data)) { // 更新用户session数据 - $this->UserLoginRecord($params['user']['id']); + self::UserLoginRecord($params['user']['id']); return DataReturn('编辑成功', 0); } @@ -1372,7 +1371,7 @@ class UserService * @param [array] $params [用户数据] * @param [string] $field [平台字段名称] */ - public function AuthUserProgram($params, $field) + public static function AuthUserProgram($params, $field) { $data = [ $field => $params['openid'], @@ -1403,7 +1402,7 @@ class UserService * @desc description * @param [array] $params [输入参数] */ - public function AppReg($params = []) + public static function AppReg($params = []) { // 数据验证 $p = [ @@ -1509,7 +1508,7 @@ class UserService // 清除验证码 $obj->Remove(); - return DataReturn('绑定成功', 0, $this->UserLoginRecord($user_id, true)); + return DataReturn('绑定成功', 0, self::UserLoginRecord($user_id, true)); } else { return DataReturn('绑定失败', -100); } @@ -1524,7 +1523,7 @@ class UserService * @desc description * @param [array] $params [输入参数] */ - public function AppUserBindVerifySend($params = []) + public static function AppUserBindVerifySend($params = []) { // 数据验证 $p = [ From a11b758d70aea559232384603d7d0597de55f1e1 Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Thu, 17 Jan 2019 01:24:37 +0800 Subject: [PATCH 2/3] wechat mini login --- application/api/controller/User.php | 2 +- public/appmini/old/weixin/app.js | 85 +++++++++---------- .../appmini/old/weixin/pages/login/login.js | 8 +- 3 files changed, 46 insertions(+), 49 deletions(-) diff --git a/application/api/controller/User.php b/application/api/controller/User.php index d6220d95c..6a681915a 100755 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -142,7 +142,7 @@ class User extends Common $result['referrer']= isset($this->data_post['referrer']) ? intval($this->data_post['referrer']) : 0; return UserService::AuthUserProgram($result, 'weixin_openid'); } - return DataReturn('获取用户信息失败', -100); + return DataReturn(empty($result) ? '获取用户信息失败' : $result, -100); } /** diff --git a/public/appmini/old/weixin/app.js b/public/appmini/old/weixin/app.js index 9f8acf363..26f4167e4 100755 --- a/public/appmini/old/weixin/app.js +++ b/public/appmini/old/weixin/app.js @@ -60,7 +60,7 @@ App({ // 请求地址 request_url: "{{request_url}}", - //request_url: 'https://test.shopxo.net/', + request_url: 'https://test.shopxo.net/', // 基础信息 application_title: "{{application_title}}", @@ -192,8 +192,9 @@ App({ * 用户登录 * object 回调操作对象 * method 回调操作对象的函数 + * auth_data 授权数据 */ - user_auth_login(object, method) { + user_auth_login(object, method, auth_data) { wx.showLoading({ title: "授权中..." }); var $this = this; wx.checkSession({ @@ -201,9 +202,9 @@ App({ var openid = wx.getStorageSync($this.data.cache_user_login_key); if ((openid || null) == null) { - $this.user_login(object, method); + $this.user_login(object, method, auth_data); } else { - $this.get_user_login_info(object, method, openid); + $this.get_user_login_info(object, method, openid, auth_data); } }, fail: function () { @@ -216,8 +217,9 @@ App({ * 用户登录 * object 回调操作对象 * method 回调操作对象的函数 + * auth_data 授权数据 */ - user_login(object, method) { + user_login(object, method, auth_data) { var $this = this; wx.login({ success: (res) => { @@ -234,7 +236,7 @@ App({ key: $this.data.cache_user_login_key, data: res.data.data }); - $this.get_user_login_info(object, method, res.data.data); + $this.get_user_login_info(object, method, res.data.data, auth_data); } else { wx.hideLoading(); $this.showToast(res.data.msg); @@ -259,48 +261,41 @@ App({ * object 回调操作对象 * method 回调操作对象的函数 * openid 用户openid + * auth_data 授权数据 */ - get_user_login_info(object, method, openid) { + get_user_login_info(object, method, openid, auth_data) { var $this = this; - wx.getUserInfo({ - withCredentials: true, - success: function (res) { - // 远程解密数据 - wx.request({ - url: $this.get_request_url('WechatUserInfo', 'user'), - method: 'POST', - data: { encrypted_data: res.encryptedData, iv: res.iv, openid: openid }, - dataType: 'json', - header: { 'content-type': 'application/x-www-form-urlencoded' }, - success: (res) => { - wx.hideLoading(); - if (res.data.code == 0) { - wx.setStorage({ - key: $this.data.cache_user_info_key, - data: res.data.data, - success: (res) => { - if (typeof object === 'object' && (method || null) != null) { - object[method](); - } - }, - fail: () => { - $this.showToast('用户信息缓存失败'); - } - }); - } else { - $this.showToast(res.data.msg); - } - }, - fail: () => { - wx.hideLoading(); - $this.showToast('服务器请求出错'); - }, - }); - }, - fail: (e) => { + + // 远程解密数据 + wx.request({ + url: $this.get_request_url('WechatUserInfo', 'user'), + method: 'POST', + data: { encrypted_data: auth_data.encryptedData, iv: auth_data.iv, openid: openid }, + dataType: 'json', + header: { 'content-type': 'application/x-www-form-urlencoded' }, + success: (res) => { wx.hideLoading(); - $this.showToast('获取用户信息失败'); - } + if (res.data.code == 0) { + wx.setStorage({ + key: $this.data.cache_user_info_key, + data: res.data.data, + success: (res) => { + if (typeof object === 'object' && (method || null) != null) { + object[method](); + } + }, + fail: () => { + $this.showToast('用户信息缓存失败'); + } + }); + } else { + $this.showToast(res.data.msg); + } + }, + fail: () => { + wx.hideLoading(); + $this.showToast('服务器请求出错'); + }, }); }, diff --git a/public/appmini/old/weixin/pages/login/login.js b/public/appmini/old/weixin/pages/login/login.js index 4151300e2..e92f513a8 100755 --- a/public/appmini/old/weixin/pages/login/login.js +++ b/public/appmini/old/weixin/pages/login/login.js @@ -30,15 +30,17 @@ Page({ * 登录授权事件 */ get_user_info_event(e) { - this.user_auth_code(); + console.log(e); + this.user_auth_code(null, null, e.detail); }, /** * 用户授权 * object 回调操作对象 * method 回调操作对象的函数 + * auth_data 授权数据 */ - user_auth_code(object, method) { + user_auth_code(object, method, auth_data) { // 请求授权接口 var $this = this; wx.getSetting({ @@ -46,7 +48,7 @@ Page({ if (!res.authSetting['scope.userInfo']) { $this.setData({ user: null}); } else { - app.user_auth_login($this, 'user_auth_back_event'); + app.user_auth_login($this, 'user_auth_back_event', auth_data); } }, fail: (e) => { From ec0c4ffe29ab8ddb7241464d8b5eaa79800f859a Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Thu, 17 Jan 2019 01:45:36 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=99=BB=E5=BD=95=E6=8E=88=E6=9D=83=E6=94=B9=E4=B8=BA?= =?UTF-8?q?button=E5=BD=A2=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/appmini/old/weixin/app.js | 5 ++--- public/appmini/old/weixin/pages/login/login.js | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/public/appmini/old/weixin/app.js b/public/appmini/old/weixin/app.js index 26f4167e4..4d9ad076b 100755 --- a/public/appmini/old/weixin/app.js +++ b/public/appmini/old/weixin/app.js @@ -60,7 +60,7 @@ App({ // 请求地址 request_url: "{{request_url}}", - request_url: 'https://test.shopxo.net/', + //request_url: 'https://test.shopxo.net/', // 基础信息 application_title: "{{application_title}}", @@ -208,7 +208,7 @@ App({ } }, fail: function () { - $this.user_login(object, method); + $this.user_login(object, method, auth_data); } }); }, @@ -265,7 +265,6 @@ App({ */ get_user_login_info(object, method, openid, auth_data) { var $this = this; - // 远程解密数据 wx.request({ url: $this.get_request_url('WechatUserInfo', 'user'), diff --git a/public/appmini/old/weixin/pages/login/login.js b/public/appmini/old/weixin/pages/login/login.js index e92f513a8..bd612176f 100755 --- a/public/appmini/old/weixin/pages/login/login.js +++ b/public/appmini/old/weixin/pages/login/login.js @@ -30,7 +30,6 @@ Page({ * 登录授权事件 */ get_user_info_event(e) { - console.log(e); this.user_auth_code(null, null, e.detail); },