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