├── AddonConfig.php
├── Install.php
├── LICENSE-SUPPLEMENTAL.md
├── LICENSE.md
├── README.md
├── UnInstall.php
├── Upgrade.php
├── api
├── controllers
│ └── DefaultController.php
└── modules
│ ├── v1
│ ├── Module.php
│ ├── controllers
│ │ ├── IndexController.php
│ │ ├── NotifyController.php
│ │ ├── SiteController.php
│ │ ├── ThirdPartyController.php
│ │ ├── common
│ │ │ ├── AdvController.php
│ │ │ ├── CollectController.php
│ │ │ ├── ConfigController.php
│ │ │ ├── FileController.php
│ │ │ ├── FollowController.php
│ │ │ ├── HelperController.php
│ │ │ ├── NiceController.php
│ │ │ ├── NotifyAnnounceController.php
│ │ │ ├── PayController.php
│ │ │ ├── ProtocolController.php
│ │ │ ├── ProvincesController.php
│ │ │ └── TransmitController.php
│ │ ├── marketing
│ │ │ ├── CouponController.php
│ │ │ ├── CouponTypeController.php
│ │ │ └── RechargeConfigController.php
│ │ ├── member
│ │ │ ├── AccountController.php
│ │ │ ├── AddressController.php
│ │ │ ├── AuthController.php
│ │ │ ├── CartItemController.php
│ │ │ ├── CollectController.php
│ │ │ ├── CouponController.php
│ │ │ ├── CreditsLogController.php
│ │ │ ├── EvaluateController.php
│ │ │ ├── FootprintController.php
│ │ │ ├── InvoiceController.php
│ │ │ ├── LevelController.php
│ │ │ ├── MemberController.php
│ │ │ ├── NotifyController.php
│ │ │ ├── NotifySubscriptionConfigController.php
│ │ │ ├── OpinionController.php
│ │ │ ├── OrderAfterSaleController.php
│ │ │ ├── OrderController.php
│ │ │ ├── OrderInvoiceController.php
│ │ │ ├── OrderProductController.php
│ │ │ └── OrderProductExpressController.php
│ │ ├── order
│ │ │ └── OrderController.php
│ │ └── product
│ │ │ ├── BrandController.php
│ │ │ ├── CateController.php
│ │ │ ├── EvaluateController.php
│ │ │ └── ProductController.php
│ └── forms
│ │ ├── AppleLoginForm.php
│ │ ├── EmailCodeForm.php
│ │ ├── InvoiceForm.php
│ │ ├── LoginForm.php
│ │ ├── MobileBindingForm.php
│ │ ├── MobileLogin.php
│ │ ├── MobileResetForm.php
│ │ ├── PeerPayForm.php
│ │ ├── RefreshForm.php
│ │ ├── RegisterEmailForm.php
│ │ ├── RegisterForm.php
│ │ ├── SmsCodeForm.php
│ │ ├── UpPayPwdForm.php
│ │ └── UpPwdForm.php
│ └── v2
│ ├── Module.php
│ └── controllers
│ └── DefaultController.php
├── backend
├── assets
│ └── AppAsset.php
├── controllers
│ └── BaseController.php
├── resources
│ └── .gitkeep
└── views
│ └── layouts
│ └── main.php
├── common
├── components
│ ├── Bootstrap.php
│ ├── InitOrderData.php
│ ├── InitOrderDataInterface.php
│ ├── PreviewHandler.php
│ ├── PreviewInterface.php
│ ├── delivery
│ │ ├── LocalDelivery.php
│ │ ├── LogisticsDelivery.php
│ │ ├── PickupDelivery.php
│ │ └── ToStoreDelivery.php
│ ├── marketing
│ │ ├── AfterHandler.php
│ │ ├── CouponHandler.php
│ │ ├── FreightHandler.php
│ │ └── FullMailHandler.php
│ ├── platform
│ │ └── PlatformUsePointHandler.php
│ └── purchase
│ │ ├── BuyAgainPurchase.php
│ │ ├── BuyNowPurchase.php
│ │ └── CartPurchase.php
├── config
│ ├── api.php
│ ├── backend.php
│ ├── frontend.php
│ ├── html5.php
│ ├── merchant.php
│ └── oauth2.php
├── enums
│ ├── AccessTokenGroupEnum.php
│ ├── AdvLocalEnum.php
│ ├── AttributeValueTypeEnum.php
│ ├── CommonModelMapEnum.php
│ ├── CouponGetTypeEnum.php
│ ├── DecimalReservationEnum.php
│ ├── DiscountTypeEnum.php
│ ├── ExplainStatusEnum.php
│ ├── ExplainTypeEnum.php
│ ├── MarketingAdvanceTypeEnum.php
│ ├── MarketingEnum.php
│ ├── MemberActiveEnum.php
│ ├── MerchantAddressTypeEnum.php
│ ├── OrderAfterSaleTypeEnum.php
│ ├── OrderInvoiceAuditStatusEnum.php
│ ├── OrderOversoldEnum.php
│ ├── OrderStatusEnum.php
│ ├── OrderTypeEnum.php
│ ├── PayGroupEnum.php
│ ├── PointConfigDeductionTypeEnum.php
│ ├── PointExchangeTypeEnum.php
│ ├── ProductExpressShippingTypeEnum.php
│ ├── ProductShippingTypeEnum.php
│ ├── ProductStockDeductionTypeEnum.php
│ ├── ProductTypeEnum.php
│ ├── ProtocolNameEnum.php
│ ├── RangeTypeEnum.php
│ ├── RefundReasonEnum.php
│ ├── RefundStatusEnum.php
│ ├── RefundTypeEnum.php
│ ├── RewardTypeEnum.php
│ ├── ShippingTypeEnum.php
│ ├── SpecTypeEnum.php
│ ├── SubscriptionActionEnum.php
│ ├── TermOfValidityTypeEnum.php
│ └── product
│ │ ├── AuditStatusEnum.php
│ │ ├── PosteCoverTypeEnum.php
│ │ └── PosteQrTypeEnum.php
├── forms
│ ├── CartItemForm.php
│ ├── CouponTypeForm.php
│ ├── EvaluateForm.php
│ ├── EvaluateStatForm.php
│ ├── OrderAfterSaleForm.php
│ ├── OrderBatchPayFrom.php
│ ├── OrderPayFrom.php
│ ├── OrderSearchForm.php
│ ├── OrderUniteBatchPayFrom.php
│ ├── OrderUnitePayFrom.php
│ ├── PreviewForm.php
│ ├── ProductSearchForm.php
│ ├── RechargePayFrom.php
│ └── SettingForm.php
├── helpers
│ └── OrderHelper.php
├── interfaces
│ └── CartItemInterface.php
├── models
│ ├── common
│ │ ├── Adv.php
│ │ ├── AdvRecord.php
│ │ ├── Attribute.php
│ │ ├── AttributeValue.php
│ │ ├── CashAgainstArea.php
│ │ ├── Collect.php
│ │ ├── ExpressCompany.php
│ │ ├── ExpressFee.php
│ │ ├── Follow.php
│ │ ├── Helper.php
│ │ ├── LocalArea.php
│ │ ├── LocalConfig.php
│ │ ├── MerchantAddress.php
│ │ ├── Nav.php
│ │ ├── Nice.php
│ │ ├── Notify.php
│ │ ├── NotifyAnnounce.php
│ │ ├── NotifyMember.php
│ │ ├── NotifyPullTime.php
│ │ ├── NotifySubscriptionConfig.php
│ │ ├── Opinion.php
│ │ ├── PlacingArea.php
│ │ ├── PopupAdv.php
│ │ ├── PopupAdvRecord.php
│ │ ├── ProductService.php
│ │ ├── ProductServiceMap.php
│ │ ├── Protocol.php
│ │ ├── SearchHistory.php
│ │ ├── Spec.php
│ │ ├── SpecTemplate.php
│ │ ├── SpecValue.php
│ │ ├── Supplier.php
│ │ └── Transmit.php
│ ├── marketing
│ │ ├── Coupon.php
│ │ ├── CouponType.php
│ │ ├── CouponTypeMap.php
│ │ ├── FullMail.php
│ │ ├── MarketingCate.php
│ │ ├── MarketingProduct.php
│ │ ├── MarketingProductSku.php
│ │ ├── MarketingStat.php
│ │ ├── PointConfig.php
│ │ └── RechargeConfig.php
│ ├── member
│ │ ├── CartItem.php
│ │ └── Footprint.php
│ ├── order
│ │ ├── AfterSale.php
│ │ ├── Invoice.php
│ │ ├── MarketingDetail.php
│ │ ├── Order.php
│ │ ├── OrderProduct.php
│ │ ├── ProductExpress.php
│ │ ├── Recharge.php
│ │ └── Store.php
│ └── product
│ │ ├── AttributeValue.php
│ │ ├── Brand.php
│ │ ├── Cate.php
│ │ ├── CateMap.php
│ │ ├── Evaluate.php
│ │ ├── EvaluateStat.php
│ │ ├── Product.php
│ │ ├── Sku.php
│ │ ├── Spec.php
│ │ ├── SpecValue.php
│ │ └── Tag.php
├── traits
│ ├── AutoCalculatePriceTrait.php
│ ├── HasOneProduct.php
│ └── ProductSelectTrait.php
└── widgets
│ ├── coupon
│ ├── CouponSelect.php
│ └── views
│ │ └── coupon.php
│ ├── link
│ ├── Link.php
│ └── views
│ │ └── index.php
│ └── product
│ ├── Product.php
│ └── views
│ └── discount.php
├── console
├── controllers
│ ├── .gitkeep
│ └── OrderController.php
└── migrations
│ ├── .gitkeep
│ ├── m230619_064744_addon_tiny_shop_common_adv.php
│ ├── m230619_064744_addon_tiny_shop_common_attribute.php
│ ├── m230619_064744_addon_tiny_shop_common_attribute_value.php
│ ├── m230619_064744_addon_tiny_shop_common_cash_against_area.php
│ ├── m230619_064744_addon_tiny_shop_common_collect.php
│ ├── m230619_064744_addon_tiny_shop_common_express_company.php
│ ├── m230619_064744_addon_tiny_shop_common_express_fee.php
│ ├── m230619_064744_addon_tiny_shop_common_helper.php
│ ├── m230619_064744_addon_tiny_shop_common_local_area.php
│ ├── m230619_064744_addon_tiny_shop_common_local_config.php
│ ├── m230619_064744_addon_tiny_shop_common_merchant_address.php
│ ├── m230619_064744_addon_tiny_shop_common_nav.php
│ ├── m230619_064744_addon_tiny_shop_common_nice.php
│ ├── m230619_064744_addon_tiny_shop_common_notify.php
│ ├── m230619_064744_addon_tiny_shop_common_notify_announce.php
│ ├── m230619_064744_addon_tiny_shop_common_notify_member.php
│ ├── m230619_064744_addon_tiny_shop_common_notify_pull_time.php
│ ├── m230619_064744_addon_tiny_shop_common_notify_subscription_config.php
│ ├── m230619_064744_addon_tiny_shop_common_opinion.php
│ ├── m230619_064744_addon_tiny_shop_common_placing_area.php
│ ├── m230619_064744_addon_tiny_shop_common_popup_adv.php
│ ├── m230619_064744_addon_tiny_shop_common_popup_adv_record.php
│ ├── m230619_064744_addon_tiny_shop_common_product_service.php
│ ├── m230619_064744_addon_tiny_shop_common_product_service_map.php
│ ├── m230619_064744_addon_tiny_shop_common_protocol.php
│ ├── m230619_064744_addon_tiny_shop_common_search_history.php
│ ├── m230619_064744_addon_tiny_shop_common_spec.php
│ ├── m230619_064744_addon_tiny_shop_common_spec_template.php
│ ├── m230619_064744_addon_tiny_shop_common_spec_value.php
│ ├── m230619_064744_addon_tiny_shop_common_supplier.php
│ ├── m230619_064744_addon_tiny_shop_common_transmit.php
│ ├── m230619_064744_addon_tiny_shop_marketing_cate.php
│ ├── m230619_064744_addon_tiny_shop_marketing_combination.php
│ ├── m230619_064744_addon_tiny_shop_marketing_consume_config.php
│ ├── m230619_064744_addon_tiny_shop_marketing_coupon.php
│ ├── m230619_064744_addon_tiny_shop_marketing_coupon_type.php
│ ├── m230619_064744_addon_tiny_shop_marketing_coupon_type_map.php
│ ├── m230619_064744_addon_tiny_shop_marketing_full_mail.php
│ ├── m230619_064744_addon_tiny_shop_marketing_point_config.php
│ ├── m230619_064744_addon_tiny_shop_marketing_product.php
│ ├── m230619_064744_addon_tiny_shop_marketing_product_sku.php
│ ├── m230619_064744_addon_tiny_shop_marketing_recharge_config.php
│ ├── m230619_064744_addon_tiny_shop_marketing_stat.php
│ ├── m230619_064744_addon_tiny_shop_member.php
│ ├── m230619_064744_addon_tiny_shop_member_cart_item.php
│ ├── m230619_064744_addon_tiny_shop_member_footprint.php
│ ├── m230619_064744_addon_tiny_shop_merchant_grade.php
│ ├── m230619_064744_addon_tiny_shop_merchant_grade_log.php
│ ├── m230619_064744_addon_tiny_shop_order.php
│ ├── m230619_064744_addon_tiny_shop_order_after_sale.php
│ ├── m230619_064744_addon_tiny_shop_order_invoice.php
│ ├── m230619_064744_addon_tiny_shop_order_marketing_detail.php
│ ├── m230619_064744_addon_tiny_shop_order_product.php
│ ├── m230619_064744_addon_tiny_shop_order_product_express.php
│ ├── m230619_064744_addon_tiny_shop_order_recharge.php
│ ├── m230619_064744_addon_tiny_shop_order_store.php
│ ├── m230619_064744_addon_tiny_shop_product.php
│ ├── m230619_064744_addon_tiny_shop_product_attribute_value.php
│ ├── m230619_064744_addon_tiny_shop_product_brand.php
│ ├── m230619_064744_addon_tiny_shop_product_cate.php
│ ├── m230619_064744_addon_tiny_shop_product_cate_map.php
│ ├── m230619_064744_addon_tiny_shop_product_evaluate.php
│ ├── m230619_064744_addon_tiny_shop_product_evaluate_stat.php
│ ├── m230619_064744_addon_tiny_shop_product_sku.php
│ ├── m230619_064744_addon_tiny_shop_product_spec.php
│ ├── m230619_064744_addon_tiny_shop_product_spec_value.php
│ └── m230619_064744_addon_tiny_shop_product_tag.php
├── docs
└── guide-zh-CN
│ └── start-update-log.md
├── frontend
├── assets
│ └── AppAsset.php
├── controllers
│ ├── BaseController.php
│ └── DefaultController.php
├── resources
│ └── .gitkeep
└── views
│ ├── default
│ └── index.php
│ └── layouts
│ └── main.php
├── html5
├── assets
│ └── AppAsset.php
├── controllers
│ ├── BaseController.php
│ └── DefaultController.php
├── resources
│ └── .gitkeep
└── views
│ ├── default
│ └── index.php
│ └── layouts
│ └── main.php
├── merchant
├── assets
│ └── AppAsset.php
├── controllers
│ ├── BaseController.php
│ ├── MemberController.php
│ ├── MerchantInfoController.php
│ └── SettingController.php
├── modules
│ ├── common
│ │ ├── Module.php
│ │ ├── controllers
│ │ │ ├── AdvController.php
│ │ │ ├── AttributeController.php
│ │ │ ├── AttributeValueController.php
│ │ │ ├── BaseSettingController.php
│ │ │ ├── CashAgainstAreaController.php
│ │ │ ├── CopyrightController.php
│ │ │ ├── ExpressCompanyController.php
│ │ │ ├── ExpressFeeController.php
│ │ │ ├── FontController.php
│ │ │ ├── HelperController.php
│ │ │ ├── HotSearchController.php
│ │ │ ├── LocalAreaController.php
│ │ │ ├── LocalConfigController.php
│ │ │ ├── MaintenanceController.php
│ │ │ ├── MerchantAddressController.php
│ │ │ ├── NotifyAnnounceController.php
│ │ │ ├── OpinionController.php
│ │ │ ├── ProductAfterSaleExplainController.php
│ │ │ ├── ProductServiceController.php
│ │ │ ├── ProductServiceMapController.php
│ │ │ ├── ProtocolController.php
│ │ │ ├── SpecController.php
│ │ │ ├── SpecTemplateController.php
│ │ │ ├── SpecValueController.php
│ │ │ └── SupplierController.php
│ │ ├── forms
│ │ │ ├── AttributeForm.php
│ │ │ ├── CopyrightForm.php
│ │ │ ├── HotSearchForm.php
│ │ │ ├── MaintenanceForm.php
│ │ │ ├── MerchantAddressForm.php
│ │ │ ├── ProductAfterSaleExplainForm.php
│ │ │ └── SpecForm.php
│ │ └── views
│ │ │ ├── adv
│ │ │ ├── edit.php
│ │ │ └── index.php
│ │ │ ├── attribute
│ │ │ ├── edit.php
│ │ │ └── index.php
│ │ │ ├── cash-against-area
│ │ │ └── edit.php
│ │ │ ├── common
│ │ │ └── _express_nav.php
│ │ │ ├── copyright
│ │ │ └── index.php
│ │ │ ├── express-company
│ │ │ ├── edit.php
│ │ │ └── index.php
│ │ │ ├── express-fee
│ │ │ ├── edit.php
│ │ │ └── index.php
│ │ │ ├── font
│ │ │ └── selector.php
│ │ │ ├── helper
│ │ │ ├── edit.php
│ │ │ └── index.php
│ │ │ ├── hot-search
│ │ │ └── index.php
│ │ │ ├── local-area
│ │ │ └── edit.php
│ │ │ ├── local-config
│ │ │ └── edit.php
│ │ │ ├── maintenance
│ │ │ └── index.php
│ │ │ ├── merchant-address
│ │ │ ├── edit.php
│ │ │ └── index.php
│ │ │ ├── notify-announce
│ │ │ ├── edit.php
│ │ │ └── index.php
│ │ │ ├── opinion
│ │ │ ├── ajax-edit.php
│ │ │ └── index.php
│ │ │ ├── product-after-sale-explain
│ │ │ └── index.php
│ │ │ ├── product-service-map
│ │ │ ├── audit.php
│ │ │ └── index.php
│ │ │ ├── product-service
│ │ │ ├── ajax-edit.php
│ │ │ └── index.php
│ │ │ ├── protocol
│ │ │ ├── edit.php
│ │ │ └── index.php
│ │ │ ├── spec-template
│ │ │ ├── ajax-edit.php
│ │ │ └── index.php
│ │ │ ├── spec
│ │ │ ├── edit.php
│ │ │ └── index.php
│ │ │ └── supplier
│ │ │ ├── ajax-edit.php
│ │ │ └── index.php
│ ├── marketing
│ │ ├── Module.php
│ │ ├── controllers
│ │ │ ├── CouponController.php
│ │ │ ├── CouponTypeController.php
│ │ │ ├── FullMailController.php
│ │ │ ├── PointConfigController.php
│ │ │ ├── ProductPosterController.php
│ │ │ └── RechargeConfigController.php
│ │ ├── forms
│ │ │ ├── CouponTypeForm.php
│ │ │ ├── CouponTypeGiveForm.php
│ │ │ ├── MarketingCouponTypeForm.php
│ │ │ ├── MarketingForm.php
│ │ │ ├── PointExchangeVerifyForm.php
│ │ │ └── ProductPosterForm.php
│ │ └── views
│ │ │ ├── coupon-type
│ │ │ ├── edit.php
│ │ │ ├── give.php
│ │ │ ├── index.php
│ │ │ └── select.php
│ │ │ ├── coupon
│ │ │ └── index.php
│ │ │ ├── full-mail
│ │ │ └── index.php
│ │ │ ├── point-config
│ │ │ └── index.php
│ │ │ ├── product-poster
│ │ │ └── index.php
│ │ │ └── recharge-config
│ │ │ ├── edit.php
│ │ │ └── index.php
│ ├── order
│ │ ├── Module.php
│ │ ├── controllers
│ │ │ ├── AfterSaleController.php
│ │ │ ├── EvaluateController.php
│ │ │ ├── InvoiceController.php
│ │ │ ├── OrderController.php
│ │ │ ├── ProductController.php
│ │ │ ├── ProductExpressController.php
│ │ │ └── RechargeController.php
│ │ ├── forms
│ │ │ ├── OrderSearchForm.php
│ │ │ ├── OrderStoreForm.php
│ │ │ ├── PriceAdjustmentForm.php
│ │ │ └── ProductExpressForm.php
│ │ └── views
│ │ │ ├── after-sale
│ │ │ ├── affirm-return.php
│ │ │ ├── company.php
│ │ │ ├── deliver.php
│ │ │ ├── detail.php
│ │ │ └── index.php
│ │ │ ├── evaluate
│ │ │ ├── ajax-edit.php
│ │ │ └── index.php
│ │ │ ├── invoice
│ │ │ ├── ajax-edit.php
│ │ │ └── index.php
│ │ │ ├── order
│ │ │ ├── _nav.php
│ │ │ ├── _operation-link.php
│ │ │ ├── _search.php
│ │ │ ├── address.php
│ │ │ ├── detail.php
│ │ │ ├── index.php
│ │ │ ├── pickup.php
│ │ │ ├── print-delivery.php
│ │ │ └── seller-memo.php
│ │ │ ├── product-express
│ │ │ ├── company.php
│ │ │ ├── create.php
│ │ │ ├── import-deliver.php
│ │ │ └── update.php
│ │ │ ├── product
│ │ │ └── price-adjustment.php
│ │ │ └── recharge
│ │ │ └── index.php
│ ├── product
│ │ ├── Module.php
│ │ ├── controllers
│ │ │ ├── BrandController.php
│ │ │ ├── CateController.php
│ │ │ ├── ProductController.php
│ │ │ └── TagController.php
│ │ ├── forms
│ │ │ ├── ProductForm.php
│ │ │ ├── ProductSearchForm.php
│ │ │ └── StockForm.php
│ │ └── views
│ │ │ ├── brand
│ │ │ ├── ajax-edit.php
│ │ │ └── index.php
│ │ │ ├── cate
│ │ │ ├── edit.php
│ │ │ └── index.php
│ │ │ ├── product
│ │ │ ├── _attribute.php
│ │ │ ├── _footer.php
│ │ │ ├── _search.php
│ │ │ ├── _specification.php
│ │ │ ├── edit.php
│ │ │ ├── index.php
│ │ │ ├── recycle.php
│ │ │ └── select.php
│ │ │ └── tag
│ │ │ ├── ajax-edit.php
│ │ │ └── index.php
│ └── statistics
│ │ ├── Module.php
│ │ ├── controllers
│ │ ├── CouponController.php
│ │ ├── GeneralController.php
│ │ ├── IndexController.php
│ │ ├── MemberController.php
│ │ ├── ProductAnalyzeController.php
│ │ ├── ProductHotController.php
│ │ ├── SearchController.php
│ │ └── TransactionAnalyzeController.php
│ │ ├── forms
│ │ └── OrderForm.php
│ │ └── views
│ │ ├── coupon
│ │ └── index.php
│ │ ├── general
│ │ └── index.php
│ │ ├── index
│ │ └── index.php
│ │ ├── member
│ │ ├── active.php
│ │ └── index.php
│ │ ├── product-analyze
│ │ └── index.php
│ │ ├── product-hot
│ │ └── index.php
│ │ ├── search
│ │ ├── index.php
│ │ └── record.php
│ │ └── transaction-analyze
│ │ └── index.php
├── resources
│ ├── .gitkeep
│ ├── css
│ │ ├── font-demo.css
│ │ └── tinyshop.css
│ ├── img
│ │ ├── bg-mobile-foot-default.png
│ │ ├── bg_mobile_head_default.png
│ │ ├── cate
│ │ │ ├── one_cover.jpg
│ │ │ ├── one_product.jpg
│ │ │ ├── one_two_cover.jpg
│ │ │ ├── one_two_product.jpg
│ │ │ ├── one_two_text.jpg
│ │ │ ├── one_two_three_cover.jpg
│ │ │ └── one_two_three_text.jpg
│ │ ├── member-header.png
│ │ ├── mobile_head.png
│ │ ├── mobile_head_old.png
│ │ ├── selected.png
│ │ ├── sku-add.png
│ │ └── style
│ │ │ ├── black.png
│ │ │ ├── blue.png
│ │ │ ├── brown.png
│ │ │ ├── green.png
│ │ │ ├── orange.png
│ │ │ ├── pink.png
│ │ │ ├── purple.png
│ │ │ └── red.png
│ ├── js
│ │ ├── sortable.min.js
│ │ ├── tinyshop.js
│ │ └── vuedraggable.min.js
│ └── plugins
│ │ └── drap
│ │ ├── css
│ │ ├── app.3f486b3a.css
│ │ └── chunk-vendors.03e1740d.css
│ │ ├── fonts
│ │ ├── element-icons.535877f5.woff
│ │ └── element-icons.732389de.ttf
│ │ ├── iconfont.css
│ │ ├── iconfont.ttf
│ │ ├── iconfont.woff
│ │ ├── iconfont.woff2
│ │ ├── img
│ │ └── crack_figure.48d77d7e.png
│ │ ├── js
│ │ ├── app.7199d3b1.js
│ │ └── chunk-vendors.0b90c59b.js
│ │ └── tinymce-all-in-one
│ │ ├── README.md
│ │ ├── langs
│ │ ├── ar.js
│ │ ├── bg_BG.js
│ │ ├── ca.js
│ │ ├── cs.js
│ │ ├── cy.js
│ │ ├── da.js
│ │ ├── de.js
│ │ ├── es.js
│ │ ├── es_ES.js
│ │ ├── es_MX.js
│ │ ├── eu.js
│ │ ├── fa.js
│ │ ├── fa_IR.js
│ │ ├── fi.js
│ │ ├── fr_FR.js
│ │ ├── gl.js
│ │ ├── he_IL.js
│ │ ├── hr.js
│ │ ├── hu_HU.js
│ │ ├── id.js
│ │ ├── it.js
│ │ ├── it_IT.js
│ │ ├── ja.js
│ │ ├── kk.js
│ │ ├── ko_KR.js
│ │ ├── lt.js
│ │ ├── nb_NO.js
│ │ ├── nl.js
│ │ ├── pl.js
│ │ ├── pt_BR.js
│ │ ├── pt_PT.js
│ │ ├── ro.js
│ │ ├── ro_RO.js
│ │ ├── ru.js
│ │ ├── sk.js
│ │ ├── sl.js
│ │ ├── sl_SI.js
│ │ ├── sv_SE.js
│ │ ├── ta.js
│ │ ├── ta_IN.js
│ │ ├── th_TH.js
│ │ ├── tr.js
│ │ ├── tr_TR.js
│ │ ├── uk.js
│ │ ├── zh_CN.js
│ │ └── zh_TW.js
│ │ ├── package.json
│ │ ├── plugins
│ │ ├── codesample
│ │ │ └── css
│ │ │ │ └── prism.css
│ │ ├── emoticons
│ │ │ └── img
│ │ │ │ ├── smiley-cool.gif
│ │ │ │ ├── smiley-cry.gif
│ │ │ │ ├── smiley-embarassed.gif
│ │ │ │ ├── smiley-foot-in-mouth.gif
│ │ │ │ ├── smiley-frown.gif
│ │ │ │ ├── smiley-innocent.gif
│ │ │ │ ├── smiley-kiss.gif
│ │ │ │ ├── smiley-laughing.gif
│ │ │ │ ├── smiley-money-mouth.gif
│ │ │ │ ├── smiley-sealed.gif
│ │ │ │ ├── smiley-smile.gif
│ │ │ │ ├── smiley-surprised.gif
│ │ │ │ ├── smiley-tongue-out.gif
│ │ │ │ ├── smiley-undecided.gif
│ │ │ │ ├── smiley-wink.gif
│ │ │ │ └── smiley-yell.gif
│ │ ├── help
│ │ │ └── img
│ │ │ │ └── logo.png
│ │ └── visualblocks
│ │ │ └── css
│ │ │ └── visualblocks.css
│ │ ├── skins
│ │ └── lightgray
│ │ │ ├── content.inline.min.css
│ │ │ ├── content.min.css
│ │ │ ├── content.mobile.min.css
│ │ │ ├── fonts
│ │ │ ├── tinymce-mobile.woff
│ │ │ ├── tinymce-small.eot
│ │ │ ├── tinymce-small.svg
│ │ │ ├── tinymce-small.ttf
│ │ │ ├── tinymce-small.woff
│ │ │ ├── tinymce.eot
│ │ │ ├── tinymce.svg
│ │ │ ├── tinymce.ttf
│ │ │ └── tinymce.woff
│ │ │ ├── img
│ │ │ ├── anchor.gif
│ │ │ ├── loader.gif
│ │ │ ├── object.gif
│ │ │ └── trans.gif
│ │ │ ├── skin.min.css
│ │ │ ├── skin.min.css.map
│ │ │ ├── skin.mobile.min.css
│ │ │ └── skin.mobile.min.css.map
│ │ └── tinymce.min.js
└── views
│ ├── layouts
│ └── main.php
│ └── setting
│ └── display.php
├── oauth2
├── controllers
│ └── DefaultController.php
└── modules
│ ├── v1
│ ├── Module.php
│ └── controllers
│ │ └── DefaultController.php
│ └── v2
│ ├── Module.php
│ └── controllers
│ └── DefaultController.php
└── services
├── Application.php
├── ConfigService.php
├── common
├── AdvService.php
├── AttributeService.php
├── AttributeValueService.php
├── CashAgainstAreaService.php
├── CollectService.php
├── ExpressCompanyService.php
├── ExpressFeeService.php
├── HelperService.php
├── LocalAreaService.php
├── LocalConfigService.php
├── NavService.php
├── NiceService.php
├── NotifyAnnounceService.php
├── NotifyMemberService.php
├── NotifyPullTimeService.php
├── NotifyService.php
├── NotifySubscriptionConfigService.php
├── ProductServiceMapService.php
├── SearchHistoryService.php
├── SpecService.php
├── SpecTemplateService.php
├── SpecValueService.php
├── SupplierService.php
└── TransmitService.php
├── marketing
├── CouponService.php
├── CouponTypeMapService.php
├── CouponTypeService.php
├── FullMailService.php
├── MarketingCateService.php
├── MarketingProductService.php
├── MarketingProductSkuService.php
├── MarketingService.php
├── MarketingStatService.php
├── PointConfigService.php
└── RechargeConfigService.php
├── member
├── CartItemService.php
├── FootprintService.php
└── MemberService.php
├── order
├── AfterSaleService.php
├── InvoiceService.php
├── MarketingDetailService.php
├── OrderBatchService.php
├── OrderService.php
├── OrderStatService.php
├── PreviewService.php
├── ProductExpressService.php
├── ProductService.php
├── RechargeService.php
└── StoreService.php
└── product
├── AttributeValueService.php
├── BrandService.php
├── CateMapService.php
├── CateService.php
├── EvaluateService.php
├── EvaluateStatService.php
├── ProductService.php
├── SkuService.php
├── SpecService.php
├── SpecValueService.php
└── TagService.php
/Install.php:
--------------------------------------------------------------------------------
1 | version) {
32 | case '3.0.0' :
33 | break;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/api/controllers/DefaultController.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 | class Module extends \yii\base\Module
10 | {
11 | /**
12 | * {@inheritdoc}
13 | */
14 | public $controllerNamespace = 'addons\TinyShop\api\modules\v1\controllers';
15 |
16 | public function init()
17 | {
18 | parent::init();
19 | }
20 | }
--------------------------------------------------------------------------------
/api/modules/v1/controllers/common/CollectController.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class CollectController extends FollowController
17 | {
18 | /**
19 | * @var Collect
20 | */
21 | public $modelClass = Collect::class;
22 |
23 | /**
24 | * @param $topic_id
25 | * @param $topic_type
26 | * @return Collect|array|\yii\db\ActiveRecord|null
27 | */
28 | public function findByTopicId($topic_id, $topic_type)
29 | {
30 | return Yii::$app->tinyShopService->collect->findByTopicId($topic_id, $topic_type, Yii::$app->user->identity->member_id);
31 | }
32 |
33 | /**
34 | * @param $id
35 | * @return Collect|array|\yii\db\ActiveRecord|null
36 | */
37 | public function findById($id)
38 | {
39 | return Yii::$app->tinyShopService->collect->findById($id, Yii::$app->user->identity->member_id);
40 | }
41 |
42 | /**
43 | * @param Collect $model
44 | * @param $class
45 | * @param $num
46 | * @return mixed
47 | */
48 | public function callBack($model, $class, $num)
49 | {
50 | /** @var Model $class */
51 | return $class::updateAllCounters(['collect_num' => $num], ['id' => $model->topic_id]);
52 | }
53 | }
--------------------------------------------------------------------------------
/api/modules/v1/controllers/common/ConfigController.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class ConfigController extends OnAuthController
17 | {
18 | public $modelClass = '';
19 |
20 | /**
21 | * 不用进行登录验证的方法
22 | *
23 | * 例如: ['index', 'update', 'create', 'view', 'delete']
24 | * 默认全部需要验证
25 | *
26 | * @var array
27 | */
28 | protected $authOptional = ['index'];
29 |
30 | /**
31 | * @return array|ActiveDataProvider
32 | */
33 | public function actionIndex()
34 | {
35 | $merchant_id = Yii::$app->services->merchant->getAutoId();
36 | $config = Yii::$app->services->addonsConfig->findConfigByCache('TinyShop', $merchant_id, true);
37 | foreach ($config as &$item) {
38 | is_numeric($item) && $item = (int)$item;
39 | }
40 |
41 | return [
42 | 'config' => $config,
43 | ];
44 | }
45 |
46 | /**
47 | * 获取基本配置
48 | *
49 | * @param int $merchant_id
50 | * @return string[]
51 | */
52 | public function actionBase(int $merchant_id)
53 | {
54 | $config = Yii::$app->services->config->merchantConfigAll(false, $merchant_id);
55 |
56 | return [
57 | 'wechat_mp_app_id' => $config['wechat_mp_app_id'] ?? '',
58 | ];
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/api/modules/v1/controllers/common/FileController.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class FileController extends OnAuthController
17 | {
18 | use FileAction;
19 |
20 | /**
21 | * @var string
22 | */
23 | public $modelClass = '';
24 |
25 | public function beforeAction($action)
26 | {
27 | // 不记录上传的图片
28 | Yii::$app->params['fileWriteTable'] = false;
29 |
30 | return parent::beforeAction($action);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/api/modules/v1/controllers/common/HelperController.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class HelperController extends OnAuthController
16 | {
17 | /**
18 | * @var Helper
19 | */
20 | public $modelClass = Helper::class;
21 |
22 |
23 | /**
24 | * 不用进行登录验证的方法
25 | * 例如: ['index', 'update', 'create', 'view', 'delete']
26 | * 默认全部需要验证
27 | *
28 | * @var array
29 | */
30 | protected $authOptional = ['index', 'view'];
31 |
32 | /**
33 | * @return array|\yii\data\ActiveDataProvider
34 | */
35 | public function actionIndex()
36 | {
37 | $data = Yii::$app->tinyShopService->helper->findAll();
38 |
39 | return ArrayHelper::itemsMerge($data, 0, 'id', 'pid', 'child');
40 | }
41 |
42 | /**
43 | * 权限验证
44 | *
45 | * @param string $action 当前的方法
46 | * @param null $model 当前的模型类
47 | * @param array $params $_GET变量
48 | * @throws \yii\web\BadRequestHttpException
49 | */
50 | public function checkAccess($action, $model = null, $params = [])
51 | {
52 | // 方法名称
53 | if (in_array($action, ['delete', 'create', 'update'])) {
54 | throw new \yii\web\BadRequestHttpException('权限不足');
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/api/modules/v1/controllers/common/NiceController.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class NiceController extends FollowController
17 | {
18 | /**
19 | * @var Nice
20 | */
21 | public $modelClass = Nice::class;
22 |
23 | /**
24 | * @param $topic_id
25 | * @param $topic_type
26 | * @return Nice|array|\yii\db\ActiveRecord|null
27 | */
28 | public function findByTopicId($topic_id, $topic_type)
29 | {
30 | return Yii::$app->tinyShopService->nice->findByTopicId($topic_id, $topic_type, Yii::$app->user->identity->member_id);
31 | }
32 |
33 | /**
34 | * @param Nice
35 | * @return Nice|array|\yii\db\ActiveRecord|null
36 | */
37 | public function findById($id)
38 | {
39 | return Yii::$app->tinyShopService->nice->findById($id, Yii::$app->user->identity->member_id);
40 | }
41 |
42 | /**
43 | * @param Nice $model
44 | * @param $class
45 | * @param $num
46 | * @return mixed
47 | */
48 | public function callBack($model, $class, $num)
49 | {
50 | /** @var Model $class */
51 | return $class::updateAllCounters(['nice_num' => $num], ['id' => $model->topic_id]);
52 | }
53 | }
--------------------------------------------------------------------------------
/api/modules/v1/controllers/common/ProtocolController.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class ProtocolController extends OnAuthController
16 | {
17 | /**
18 | * @var string
19 | */
20 | public $modelClass = '';
21 |
22 | /**
23 | * 不用进行登录验证的方法
24 | * 例如: ['index', 'update', 'create', 'view', 'delete']
25 | * 默认全部需要验证
26 | *
27 | * @var array
28 | */
29 | public $authOptional = ['detail'];
30 |
31 | /**
32 | * @param $name
33 | * @return array|\yii\db\ActiveRecord|null
34 | */
35 | public function actionDetail($name)
36 | {
37 | $data = Protocol::find()
38 | ->where(['name' => $name, 'status' => StatusEnum::ENABLED])
39 | ->andWhere(['merchant_id' => Yii::$app->services->merchant->getNotNullId()])
40 | ->one();
41 |
42 | if (empty($data)) {
43 | $data = new Protocol();
44 | }
45 |
46 | return $data;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/api/modules/v1/controllers/common/ProvincesController.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class ProvincesController extends OnAuthController
17 | {
18 | /**
19 | * @var Provinces
20 | */
21 | public $modelClass = Provinces::class;
22 |
23 | /**
24 | * 不用进行登录验证的方法
25 | * 例如: ['index', 'update', 'create', 'view', 'delete']
26 | * 默认全部需要验证
27 | *
28 | * @var array
29 | */
30 | protected $authOptional = ['index'];
31 |
32 | /**
33 | * 获取省市区
34 | *
35 | * @param int $pid
36 | * @return array|yii\data\ActiveDataProvider
37 | */
38 | public function actionIndex()
39 | {
40 | $pid = Yii::$app->request->get('pid', 0);
41 |
42 | return Yii::$app->services->provinces->getCityByPid($pid);
43 | }
44 |
45 | /**
46 | * 权限验证
47 | *
48 | * @param string $action 当前的方法
49 | * @param null $model 当前的模型类
50 | * @param array $params $_GET变量
51 | * @throws \yii\web\BadRequestHttpException
52 | */
53 | public function checkAccess($action, $model = null, $params = [])
54 | {
55 | // 方法名称
56 | if (in_array($action, ['create', 'update', 'delete'])) {
57 | throw new \yii\web\BadRequestHttpException('权限不足');
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/api/modules/v1/controllers/marketing/CouponController.php:
--------------------------------------------------------------------------------
1 | request->post('code');
28 | $member_id = Yii::$app->user->identity->member_id;
29 |
30 | if (empty($code)) {
31 | throw new UnprocessableEntityHttpException('请填写兑换码');
32 | }
33 |
34 | $model = Yii::$app->tinyShopService->marketingCoupon->conversion($code, $member_id);
35 |
36 | return $model;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/api/modules/v1/controllers/marketing/RechargeConfigController.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class RechargeConfigController extends OnAuthController
17 | {
18 | protected $authOptional = ['index'];
19 |
20 | /**
21 | * @var RechargeConfig
22 | */
23 | public $modelClass = RechargeConfig::class;
24 |
25 | /**
26 | * @return array
27 | */
28 | public function actionIndex()
29 | {
30 | return $this->modelClass::find()
31 | ->where(['status' => StatusEnum::ENABLED])
32 | ->andFilterWhere(['merchant_id' => $this->getMerchantId()])
33 | ->orderBy('price asc')
34 | ->asArray()
35 | ->all();
36 | }
37 |
38 | /**
39 | * 权限验证
40 | *
41 | * @param string $action 当前的方法
42 | * @param null $model 当前的模型类
43 | * @param array $params $_GET变量
44 | * @throws \yii\web\BadRequestHttpException
45 | */
46 | public function checkAccess($action, $model = null, $params = [])
47 | {
48 | // 方法名称
49 | if (in_array($action, ['delete', 'update', 'create'])) {
50 | throw new \yii\web\BadRequestHttpException('权限不足');
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/api/modules/v1/controllers/member/InvoiceController.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class InvoiceController extends \api\modules\v1\controllers\member\InvoiceController
13 | {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/api/modules/v1/controllers/member/OrderProductExpressController.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class OrderProductExpressController extends UserAuthController
15 | {
16 | /**
17 | * @var ProductExpress
18 | */
19 | public $modelClass = '';
20 |
21 | /**
22 | * @return array
23 | */
24 | public function actionDetails()
25 | {
26 | $member_id = Yii::$app->user->identity->member_id;
27 | $order_id = Yii::$app->request->get('order_id');
28 |
29 | return Yii::$app->tinyShopService->orderProductExpress->getStatusByOrderId($order_id, $member_id);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/api/modules/v1/forms/AppleLoginForm.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class AppleLoginForm extends Model
13 | {
14 | public $user;
15 | public $email;
16 | public $authorizationCode;
17 | public $identityToken;
18 | public $fullName;
19 | public $realUserStatus;
20 |
21 | /**
22 | * @return array|array[]
23 | */
24 | public function rules()
25 | {
26 | return [
27 | [['user', 'identityToken'], 'required'],
28 | [['user', 'email', 'authorizationCode', 'identityToken'], 'string'],
29 | [['fullName'], 'safe'],
30 | [['realUserStatus'], 'integer'],
31 | ];
32 | }
33 |
34 | /**
35 | * @return array|string[]
36 | */
37 | public function attributeLabels()
38 | {
39 | return [
40 | 'user' => 'openId',
41 | 'identityToken' => '授权 token',
42 | 'email' => '邮箱',
43 | 'authorizationCode' => '授权码',
44 | 'fullName' => '用户名称',
45 | 'realUserStatus' => '用户状态',
46 | ];
47 | }
48 | }
--------------------------------------------------------------------------------
/api/modules/v1/forms/InvoiceForm.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class InvoiceForm extends Model
15 | {
16 | public $member_id;
17 | public $order_id;
18 | public $invoice_id;
19 | public $invoice_content;
20 |
21 | /**
22 | * @var Invoice
23 | */
24 | public $invoice;
25 |
26 | /**
27 | * {@inheritdoc}
28 | */
29 | public function rules()
30 | {
31 | return [
32 | [['invoice_id', 'invoice_content', 'order_id', 'member_id'], 'required'],
33 | [['invoice_id', 'order_id', 'member_id'], 'integer'],
34 | [['invoice_content'], 'string', 'max' => 500],
35 | [['invoice_id'], 'invoiceVerify'],
36 | ];
37 | }
38 |
39 | /**
40 | * 发票校验
41 | *
42 | * @param $attribute
43 | */
44 | public function invoiceVerify($attribute)
45 | {
46 | $this->invoice = Yii::$app->services->memberInvoice->findById($this->invoice_id, $this->member_id);
47 |
48 | if (!$this->invoice) {
49 | $this->addError($attribute, '发票信息不存在');
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/api/modules/v1/forms/LoginForm.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class LoginForm extends \common\forms\LoginForm
15 | {
16 | public $group;
17 | public $mobile;
18 |
19 | /**
20 | * @inheritdoc
21 | */
22 | public function rules()
23 | {
24 | return [
25 | [['mobile', 'password', 'group'], 'required'],
26 | ['password', 'validatePassword'],
27 | ['group', 'in', 'range' => AccessTokenGroupEnum::getKeys()]
28 | ];
29 | }
30 |
31 | public function attributeLabels()
32 | {
33 | return [
34 | 'mobile' => '手机号码',
35 | 'password' => '登录密码',
36 | 'group' => '组别',
37 | ];
38 | }
39 |
40 | /**
41 | * 用户登录
42 | *
43 | * @return mixed|null|static
44 | */
45 | public function getUser()
46 | {
47 | if ($this->_user == false) {
48 | $this->_user = Yii::$app->services->member->findByCondition([
49 | 'mobile' => $this->mobile,
50 | 'type' => MemberTypeEnum::MEMBER,
51 | 'merchant_id' => Yii::$app->services->merchant->getNotNullId(),
52 | ]);
53 | }
54 |
55 | return $this->_user;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/api/modules/v1/forms/PeerPayForm.php:
--------------------------------------------------------------------------------
1 | 200],
20 | ];
21 | }
22 | }
--------------------------------------------------------------------------------
/api/modules/v2/Module.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 | class Module extends \yii\base\Module
10 | {
11 | /**
12 | * {@inheritdoc}
13 | */
14 | public $controllerNamespace = 'addons\TinyShop\api\modules\v2\controllers';
15 |
16 | public function init()
17 | {
18 | parent::init();
19 | }
20 | }
--------------------------------------------------------------------------------
/api/modules/v2/controllers/DefaultController.php:
--------------------------------------------------------------------------------
1 |
9 | beginPage() ?>
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | registerCsrfMetaTags() ?>
21 | = Html::encode($this->title) ?>
22 | head() ?>
23 |
24 |
25 | beginBody() ?>
26 | = $content ?>
27 | endBody() ?>
28 |
29 |
30 | endPage() ?>
31 |
--------------------------------------------------------------------------------
/common/components/PreviewInterface.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | abstract class PreviewInterface
15 | {
16 | /**
17 | * @var bool
18 | */
19 | public $status = false;
20 | /**
21 | * 创建记录
22 | *
23 | * @var bool
24 | */
25 | public $isNewRecord = false;
26 |
27 | /**
28 | * 执行
29 | *
30 | * @param PreviewForm $form
31 | * @return mixed
32 | */
33 | abstract public function execute(PreviewForm $form): PreviewForm;
34 |
35 | /**
36 | * 排斥的营销名称
37 | *
38 | * 例如: ['fee']
39 | *
40 | * @return array
41 | */
42 | abstract public function rejectNames();
43 |
44 | /**
45 | * 营销名称
46 | *
47 | * @return string
48 | */
49 | abstract public static function getName(): string;
50 |
51 | /**
52 | * 触发营销成功
53 | *
54 | * @param PreviewForm $form
55 | * @return PreviewForm
56 | */
57 | public function success(PreviewForm $form): PreviewForm
58 | {
59 | $this->status = true;
60 |
61 | return $form;
62 | }
63 | }
--------------------------------------------------------------------------------
/common/components/delivery/ToStoreDelivery.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class ToStoreDelivery extends PreviewInterface
17 | {
18 | /**
19 | * @param PreviewForm $form
20 | * @return PreviewForm
21 | * @throws UnprocessableEntityHttpException
22 | */
23 | public function execute(PreviewForm $form): PreviewForm
24 | {
25 | if (!$form->store) {
26 | throw new UnprocessableEntityHttpException('门店地点不存在');
27 | }
28 |
29 | $form->shipping_money = 0;
30 |
31 | return $form;
32 | }
33 |
34 | /**
35 | * 排斥营销
36 | *
37 | * @return array
38 | */
39 | public function rejectNames()
40 | {
41 | return [];
42 | }
43 |
44 | /**
45 | * 营销名称
46 | *
47 | * @return string
48 | */
49 | public static function getName(): string
50 | {
51 | return 'toStore';
52 | }
53 | }
--------------------------------------------------------------------------------
/common/config/api.php:
--------------------------------------------------------------------------------
1 | [
7 | // 菜单配置
8 | 'menu' => [
9 | 'location' => 'addons', // default:系统顶部菜单;addons:应用中心菜单
10 | 'icon' => 'fa fa-puzzle-piece',
11 | 'pattern' => [], // 可见开发模式 b2c、b2b2c、saas 不填默认全部可见, 可设置为 blank 为全部不可见
12 | ],
13 | // 子模块配置
14 | 'modules' => [
15 | 'v1' => [
16 | 'class' => 'addons\TinyShop\api\modules\v1\Module',
17 | ],
18 | 'v2' => [
19 | 'class' => 'addons\TinyShop\api\modules\v2\Module',
20 | ],
21 | ],
22 | ],
23 |
24 | // ----------------------- 菜单配置 ----------------------- //
25 |
26 | 'menu' => [
27 |
28 | ],
29 |
30 | // ----------------------- 权限配置 ----------------------- //
31 |
32 | 'authItem' => [
33 | ],
34 | ];
35 |
--------------------------------------------------------------------------------
/common/config/frontend.php:
--------------------------------------------------------------------------------
1 | [
7 | // 菜单配置
8 | 'menu' => [
9 | 'location' => 'addons', // default:系统顶部菜单;addons:应用中心菜单
10 | 'icon' => 'fa fa-puzzle-piece',
11 | 'pattern' => [], // 可见开发模式 b2c、b2b2c、saas 不填默认全部可见, 可设置为 blank 为全部不可见
12 | ],
13 | // 子模块配置
14 | 'modules' => [
15 | ],
16 | ],
17 |
18 | // ----------------------- 菜单配置 ----------------------- //
19 |
20 | 'menu' => [
21 |
22 | ],
23 |
24 | // ----------------------- 权限配置 ----------------------- //
25 |
26 | 'authItem' => [
27 | ],
28 | ];
29 |
--------------------------------------------------------------------------------
/common/config/html5.php:
--------------------------------------------------------------------------------
1 | [
7 | // 菜单配置
8 | 'menu' => [
9 | 'location' => 'addons', // default:系统顶部菜单;addons:应用中心菜单
10 | 'icon' => 'fa fa-puzzle-piece',
11 | 'pattern' => [], // 可见开发模式 b2c、b2b2c、saas 不填默认全部可见, 可设置为 blank 为全部不可见
12 | ],
13 | // 子模块配置
14 | 'modules' => [
15 | ],
16 | ],
17 |
18 | // ----------------------- 菜单配置 ----------------------- //
19 |
20 | 'menu' => [
21 |
22 | ],
23 |
24 | // ----------------------- 权限配置 ----------------------- //
25 |
26 | 'authItem' => [
27 | ],
28 | ];
29 |
--------------------------------------------------------------------------------
/common/config/merchant.php:
--------------------------------------------------------------------------------
1 | [
7 | // 菜单配置
8 | 'menu' => [
9 | 'location' => 'default', // default:系统顶部菜单;addons:应用中心菜单
10 | 'icon' => 'fa fa-shopping-bag',
11 | 'sort' => 200, // 自定义排序
12 | 'pattern' => ['b2b2c']
13 | ],
14 | // 子模块配置
15 | 'modules' => [
16 |
17 | ],
18 | ],
19 |
20 | // ----------------------- 菜单配置 ----------------------- //
21 |
22 | 'menu' => [
23 |
24 | ],
25 |
26 | // ----------------------- 权限配置 ----------------------- //
27 |
28 | 'authItem' => [
29 |
30 | ],
31 | ];
32 |
--------------------------------------------------------------------------------
/common/config/oauth2.php:
--------------------------------------------------------------------------------
1 | [
7 | // 菜单配置
8 | 'menu' => [
9 | 'location' => 'addons', // default:系统顶部菜单;addons:应用中心菜单
10 | 'icon' => 'fa fa-puzzle-piece',
11 | 'pattern' => [], // 可见开发模式 b2c、b2b2c、saas 不填默认全部可见, 可设置为 blank 为全部不可见
12 | ],
13 | // 子模块配置
14 | 'modules' => [
15 | 'v1' => [
16 | 'class' => 'addons\TinyShop\oauth2\modules\v1\Module',
17 | ],
18 | 'v2' => [
19 | 'class' => 'addons\TinyShop\oauth2\modules\v2\Module',
20 | ],
21 | ],
22 | ],
23 |
24 | // ----------------------- 菜单配置 ----------------------- //
25 |
26 | 'menu' => [
27 |
28 | ],
29 |
30 | // ----------------------- 权限配置 ----------------------- //
31 |
32 | 'authItem' => [
33 | ],
34 | ];
35 |
--------------------------------------------------------------------------------
/common/enums/AttributeValueTypeEnum.php:
--------------------------------------------------------------------------------
1 | '输入框',
21 | self::RADIO => '单选框',
22 | self::CHECK => '复选框',
23 | ];
24 | }
25 | }
--------------------------------------------------------------------------------
/common/enums/CommonModelMapEnum.php:
--------------------------------------------------------------------------------
1 |
17 | */
18 | class CommonModelMapEnum extends BaseEnum
19 | {
20 | const PRODUCT = 'product';
21 | const MERCHANT = 'merchant';
22 |
23 | /**
24 | * @return array
25 | */
26 | public static function getMap(): array
27 | {
28 | return [
29 | self::PRODUCT => Product::class,
30 | self::MERCHANT => Merchant::class,
31 | ];
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/common/enums/CouponGetTypeEnum.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class CouponGetTypeEnum extends BaseEnum
15 | {
16 | const ORDER = 1;
17 | const ONESELF = 2;
18 | const MANAGER = 3;
19 | const REGISTER = 4;
20 | const REDEEM_CODE = 5;
21 | const MEMBER_CARD = 6;
22 | const MEMBER_INVITE = 7;
23 | const RECHARGE = 8;
24 |
25 | /**
26 | * @return array|string[]
27 | */
28 | public static function getMap(): array
29 | {
30 | return [
31 | self::ORDER => '订单赠送',
32 | self::ONESELF => '主动领取',
33 | self::MANAGER => '管理员赠送',
34 | self::REGISTER => '注册赠送',
35 | self::REDEEM_CODE => '兑换码兑换',
36 | self::MEMBER_CARD => '会员卡赠送',
37 | self::MEMBER_INVITE => '邀请好友赠送',
38 | self::RECHARGE => '充值',
39 | ];
40 | }
41 |
42 | /**
43 | * @return int[]
44 | */
45 | public static function getShowMap(): array
46 | {
47 | return [
48 | self::ORDER, // 订单赠送
49 | self::MANAGER, // 管理员赠送
50 | self::REGISTER, // 注册赠送
51 | self::MEMBER_CARD, // 会员卡赠送
52 | self::MEMBER_INVITE, // 邀请好友赠送
53 | self::RECHARGE, // 充值赠送
54 | ];
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/common/enums/DecimalReservationEnum.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class DecimalReservationEnum extends BaseEnum
15 | {
16 | const DEFAULT = -1;
17 | const CLEAR_DECIMAL_TWO = 0;
18 | const CLEAR_DECIMAL_ONE = 1;
19 |
20 | /**
21 | * @return array
22 | */
23 | public static function getMap(): array
24 | {
25 | return [
26 | self::DEFAULT => '保留角和分',
27 | self::CLEAR_DECIMAL_TWO => '抹去角和分',
28 | self::CLEAR_DECIMAL_ONE => '抹去分',
29 | ];
30 | }
31 | }
--------------------------------------------------------------------------------
/common/enums/DiscountTypeEnum.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class DiscountTypeEnum extends BaseEnum
15 | {
16 | const MONEY = 1;
17 | const DISCOUNT = 2;
18 | const FIXATION = 3;
19 |
20 | /**
21 | * @return array
22 | */
23 | public static function getMap(): array
24 | {
25 | return [
26 | self::MONEY => '减钱',
27 | self::DISCOUNT => '折扣',
28 | ];
29 | }
30 |
31 | /**
32 | * @return array
33 | */
34 | public static function getAllMap(): array
35 | {
36 | return [
37 | self::MONEY => '减钱',
38 | self::DISCOUNT => '折扣',
39 | self::FIXATION => '促销价',
40 | ];
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/common/enums/ExplainStatusEnum.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class ExplainStatusEnum extends BaseEnum
15 | {
16 | const DEAULT = 0;
17 | const EVALUATE = 1;
18 | const SUPERADDITION = 2;
19 |
20 | /**
21 | * @return array
22 | */
23 | public static function getMap(): array
24 | {
25 | return [
26 | self::DEAULT => '未评价',
27 | self::EVALUATE => '已评价',
28 | self::SUPERADDITION => '已追加评价',
29 | ];
30 | }
31 | }
--------------------------------------------------------------------------------
/common/enums/ExplainTypeEnum.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class ExplainTypeEnum extends BaseEnum
15 | {
16 | const NEGATIVE = 1;
17 | const ORDINARY = 2;
18 | const GOOD = 3;
19 |
20 | /**
21 | * @return array
22 | */
23 | public static function getMap(): array
24 | {
25 | return [
26 | self::NEGATIVE => '差评',
27 | self::ORDINARY => '中评',
28 | self::GOOD => '好评',
29 | ];
30 | }
31 |
32 | /**
33 | * @param $scores
34 | * @return int
35 | */
36 | public static function scoresToType($scores)
37 | {
38 | if (in_array($scores, [1, 2])) {
39 | return self::NEGATIVE;
40 | }
41 |
42 | if (in_array($scores, [3])) {
43 | return self::ORDINARY;
44 | }
45 |
46 | return self::GOOD;
47 | }
48 | }
--------------------------------------------------------------------------------
/common/enums/MarketingAdvanceTypeEnum.php:
--------------------------------------------------------------------------------
1 | '立即预告',
26 | self::ADVANCE_NOTICE => '活动前 N 小时',
27 | self::NOT_NOTICE => '不进行预告',
28 | ];
29 | }
30 |
31 | /**
32 | * @return string[]
33 | */
34 | public static function getCurtailMap(): array
35 | {
36 | return [
37 | self::IMMEDIATE_NOTICE => '立即预告',
38 | self::NOT_NOTICE => '不进行预告',
39 | ];
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/common/enums/MerchantAddressTypeEnum.php:
--------------------------------------------------------------------------------
1 | '未定义',
23 | self::SALES_RETURN => '退货地址',
24 | ];
25 | }
26 | }
--------------------------------------------------------------------------------
/common/enums/OrderAfterSaleTypeEnum.php:
--------------------------------------------------------------------------------
1 |
12 | */
13 | class OrderAfterSaleTypeEnum extends BaseEnum
14 | {
15 | const IN_SALE = 1;
16 | const AFTER_SALE = 2;
17 |
18 | /**
19 | * @return array
20 | */
21 | public static function getMap(): array
22 | {
23 | return [
24 | self::IN_SALE => '售中',
25 | self::AFTER_SALE => '售后'
26 | ];
27 | }
28 |
29 |
30 | /**
31 | * 是否标签
32 | *
33 | * @param int $status
34 | * @return mixed
35 | */
36 | public static function html(int $status)
37 | {
38 | $listBut = [
39 | self::IN_SALE => Html::tag('span', self::getValue(self::IN_SALE), [
40 | 'class' => "label label-outline-success label-sm",
41 | ]),
42 | self::AFTER_SALE => Html::tag('span', self::getValue(self::AFTER_SALE), [
43 | 'class' => "label label-outline-danger label-sm",
44 | ]),
45 | ];
46 |
47 | return $listBut[$status] ?? '';
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/common/enums/OrderOversoldEnum.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class OrderOversoldEnum extends BaseEnum
13 | {
14 | const MANUAL_WORK = 1;
15 | const AUTO_REFUND = 2;
16 |
17 | /**
18 | * @return string[]
19 | */
20 | public static function getMap(): array
21 | {
22 | return [
23 | self::MANUAL_WORK => '人工处理',
24 | // self::AUTO_REFUND => '系统自动退款',
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/common/enums/OrderTypeEnum.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class OrderTypeEnum extends BaseEnum
15 | {
16 | const ORDINARY = 1;
17 |
18 | /**
19 | * @return array
20 | */
21 | public static function getMap(): array
22 | {
23 | return [
24 | self::ORDINARY => '普通订单',
25 | ];
26 | }
27 |
28 | /**
29 | * @return array
30 | */
31 | public static function getAliasMap(): array
32 | {
33 | return [
34 | self::ORDINARY => 'Ordinary',
35 | ];
36 | }
37 |
38 | /**
39 | * @param $key
40 | * @return string
41 | */
42 | public static function getAlias($key): string
43 | {
44 | return static::getAliasMap()[$key] ?? '';
45 | }
46 |
47 | /**
48 | * 正常的订单类型
49 | *
50 | * @return array
51 | */
52 | public static function normal()
53 | {
54 | return [
55 | self::ORDINARY, // 普通订单
56 | ];
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/common/enums/PayGroupEnum.php:
--------------------------------------------------------------------------------
1 | '订单支付',
26 | self::ORDER_UNITE => '订单混合支付', // 余额 + 第三方支付
27 | self::ORDER_BATCH => '订单批量支付',
28 | self::ORDER_UNITE_BATCH => '订单混合批量支付', // 余额 + 第三方支付
29 | self::RECHARGE => '充值',
30 | ];
31 | }
32 |
33 | /**
34 | * @return array
35 | */
36 | public static function getOrderDetailMap(): array
37 | {
38 | return [
39 | self::ORDER => '订单支付',
40 | self::ORDER_UNITE => '订单混合支付', // 余额 + 第三方支付
41 | self::ORDER_BATCH => '订单支付',
42 | self::ORDER_UNITE_BATCH => '订单混合支付', // 余额 + 第三方支付
43 | ];
44 | }
45 |
46 | /**
47 | * @param $key
48 | * @return string
49 | */
50 | public static function getOrderDetailValue($key): string
51 | {
52 | return static::getOrderDetailMap()[$key] ?? '';
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/common/enums/PointConfigDeductionTypeEnum.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class PointConfigDeductionTypeEnum extends BaseEnum
13 | {
14 | const NOT = 0;
15 | const MONEY = 1;
16 | const RATE = 2;
17 |
18 | /**
19 | * @return string[]
20 | */
21 | public static function getMap(): array
22 | {
23 | return [
24 | self::NOT => '不限制',
25 | self::MONEY => '订单金额',
26 | self::RATE => '订单比率',
27 | ];
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/common/enums/PointExchangeTypeEnum.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class PointExchangeTypeEnum extends BaseEnum
15 | {
16 | const PRODUCT = 1;
17 | const COUPON = 2;
18 | const BALANCE = 3;
19 |
20 | /**
21 | * @return array
22 | */
23 | public static function getMap(): array
24 | {
25 | return [
26 | self::PRODUCT => '商品',
27 | // self::COUPON => '优惠券',
28 | // self::BALANCE => '余额',
29 | ];
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/common/enums/ProductExpressShippingTypeEnum.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class ProductExpressShippingTypeEnum extends BaseEnum
13 | {
14 | const NOT_LOGISTICS = 0;
15 | const LOGISTICS = 1;
16 |
17 | /**
18 | * @return string[]
19 | */
20 | public static function getMap(): array
21 | {
22 | return [
23 | self::NOT_LOGISTICS => '无需物流',
24 | self::LOGISTICS => '需要物流',
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/common/enums/ProductShippingTypeEnum.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class ProductShippingTypeEnum extends BaseEnum
13 | {
14 | const FULL_MAIL = 1;
15 | const USER_PAY = 2;
16 | const FIXATION = 3;
17 |
18 | /**
19 | * @return array
20 | */
21 | public static function getMap(): array
22 | {
23 | return [
24 | self::FULL_MAIL => '包邮',
25 | self::USER_PAY => '买家承担运费',
26 | self::FIXATION => '统一邮费',
27 | ];
28 | }
29 | }
--------------------------------------------------------------------------------
/common/enums/ProductStockDeductionTypeEnum.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class ProductStockDeductionTypeEnum extends BaseEnum
13 | {
14 | const PAY = 1;
15 | const CREATE = 2;
16 |
17 | /**
18 | * @return string[]
19 | */
20 | public static function getMap(): array
21 | {
22 | return [
23 | self::PAY => '付款减库存',
24 | self::CREATE => '拍下减库存',
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/common/enums/ProtocolNameEnum.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class ProtocolNameEnum extends BaseEnum
15 | {
16 | const REGISTER = 'register';
17 | const PRIVACY = 'privacy';
18 | const RECHARGE = 'recharge';
19 | const MEMBER_CARD = 'member_card';
20 | const MEMBER_CARD_RIGHTS = 'member_card_rights';
21 |
22 | /**
23 | * @return array
24 | */
25 | public static function getMap(): array
26 | {
27 | return [
28 | self::REGISTER => '注册协议',
29 | self::PRIVACY => '隐私协议',
30 | self::RECHARGE => '充值协议',
31 | self::MEMBER_CARD => '会员开卡协议',
32 | self::MEMBER_CARD_RIGHTS => '会员权益细则',
33 | ];
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/common/enums/RefundReasonEnum.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class RefundReasonEnum extends BaseEnum
15 | {
16 | const INCORRECT_SELECTION = 1; // 拍错/多拍
17 | const NO_LONGER_WANT = 2; // 不想要了
18 | const NO_EXPRESS_INFO = 3; // 无快递信息
19 | const EMPTY_PACKAGE = 4; // 包裹为空
20 | const REJECT_RECEIVE_PACKAGE = 5; // 已拒签包裹
21 | const NOT_DELIVERED_TOO_LONG = 6; // 快递长时间未送达
22 | const NOT_MATCH_PRODUCT_DESC = 7; // 与商品描述不符
23 | const QUALITY_ISSUE = 8; // 质量问题
24 | const SEND_WRONG_GOODS = 9; // 卖家发错货
25 | const THREE_NO_PRODUCT = 10; // 三无产品
26 | const FAKE_PRODUCT = 11; // 假冒产品
27 | const OTHERS = 12; // 其它
28 |
29 | /**
30 | * @return array
31 | */
32 | public static function getMap(): array
33 | {
34 | return [
35 | self::INCORRECT_SELECTION => '拍错/多拍',
36 | self::NO_LONGER_WANT => '不想要了',
37 | self::NO_EXPRESS_INFO => '无快递信息',
38 | self::EMPTY_PACKAGE => '包裹为空',
39 | self::REJECT_RECEIVE_PACKAGE => '已拒签包裹',
40 | self::NOT_DELIVERED_TOO_LONG => '快递长时间未送达',
41 | self::NOT_MATCH_PRODUCT_DESC => '与商品描述不符',
42 | self::QUALITY_ISSUE => '质量问题',
43 | self::SEND_WRONG_GOODS => '卖家发错货',
44 | self::THREE_NO_PRODUCT => '三无产品',
45 | self::FAKE_PRODUCT => '假冒产品',
46 | self::OTHERS => '其他',
47 | ];
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/common/enums/RefundTypeEnum.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class RefundTypeEnum extends BaseEnum
16 | {
17 | const MONEY = 1;
18 | const MONEY_AND_PRODUCT = 2;
19 | const EXCHANGE_PRODUCT = 3;
20 |
21 | /**
22 | * @return array
23 | */
24 | public static function getMap(): array
25 | {
26 | return [
27 | self::MONEY => '仅退款',
28 | self::MONEY_AND_PRODUCT => '退款且退货',
29 | self::EXCHANGE_PRODUCT => '换货',
30 | ];
31 | }
32 |
33 | /**
34 | * 是否标签
35 | *
36 | * @param int $status
37 | * @return mixed
38 | */
39 | public static function html(int $status)
40 | {
41 | $listBut = [
42 | self::MONEY => Html::tag('span', self::getValue(self::MONEY), [
43 | 'class' => "label label-outline-info label-sm",
44 | ]),
45 | self::MONEY_AND_PRODUCT => Html::tag('span', self::getValue(self::MONEY_AND_PRODUCT), [
46 | 'class' => "label label-outline-primary label-sm",
47 | ]),
48 | self::EXCHANGE_PRODUCT => Html::tag('span', self::getValue(self::EXCHANGE_PRODUCT), [
49 | 'class' => "label label-outline-purple label-sm",
50 | ]),
51 | ];
52 |
53 | return $listBut[$status] ?? '';
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/common/enums/RewardTypeEnum.php:
--------------------------------------------------------------------------------
1 | '不处理',
29 | self::BALANCE => '消费余额',
30 | self::RED_PACKET => '现金红包',
31 | self::COUPON => '优惠券',
32 | self::POINT => '积分',
33 | self::PRODUCT => '商品',
34 | ];
35 | }
36 |
37 | /**
38 | * @return array
39 | */
40 | public static function getCurtailMap(): array
41 | {
42 | return [
43 | self::BALANCE => '消费余额',
44 | self::COUPON => '优惠券',
45 | self::POINT => '积分',
46 | ];
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/common/enums/SpecTypeEnum.php:
--------------------------------------------------------------------------------
1 | '文字',
26 | // self::COLOR => '颜色',
27 | self::IMAGE => '图片',
28 | ];
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/common/enums/TermOfValidityTypeEnum.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class TermOfValidityTypeEnum extends BaseEnum
13 | {
14 | const FIXATION = 0;
15 | const GET = 1;
16 |
17 | /**
18 | * @return string[]
19 | */
20 | public static function getMap(): array
21 | {
22 | return[
23 | self::FIXATION => '固定时间',
24 | self::GET => '领到券当日开始 N 天内有效',
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/common/enums/product/PosteCoverTypeEnum.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class PosteCoverTypeEnum extends BaseEnum
13 | {
14 | const ROUNDNESS = 'roundness';
15 | const QUADRATE = 'quadrate';
16 |
17 | /**
18 | * @return array|string[]
19 | */
20 | public static function getMap(): array
21 | {
22 | return [
23 | self::ROUNDNESS => '圆形',
24 | self::QUADRATE => '正方形',
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/common/enums/product/PosteQrTypeEnum.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class PosteQrTypeEnum extends BaseEnum
13 | {
14 | const COMMON_QR = 'common_qr';
15 | const MINI_PROGRAM_QR = 'mini_program_qr';
16 |
17 | /**
18 | * @return array|string[]
19 | */
20 | public static function getMap(): array
21 | {
22 | return [
23 | self::COMMON_QR => '普通二维码',
24 | self::MINI_PROGRAM_QR => '小程序二维码',
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/common/forms/EvaluateStatForm.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class EvaluateStatForm extends Model
13 | {
14 | /**
15 | * 评价图
16 | *
17 | * @var bool
18 | */
19 | public $has_cover = false;
20 | /**
21 | * 评价视频
22 | *
23 | * @var bool
24 | */
25 | public $has_video = false;
26 | /**
27 | * 是否追加
28 | *
29 | * @var bool
30 | */
31 | public $has_again = false;
32 | /**
33 | * 好评
34 | *
35 | * @var bool
36 | */
37 | public $has_good = false;
38 | /**
39 | * 中评
40 | *
41 | * @var bool
42 | */
43 | public $has_ordinary = false;
44 | /**
45 | * 差评
46 | *
47 | * @var bool
48 | */
49 | public $has_negative = false;
50 | }
51 |
--------------------------------------------------------------------------------
/common/forms/OrderAfterSaleForm.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class OrderAfterSaleForm extends AfterSale
13 | {
14 | /**
15 | * @return array
16 | */
17 | public function rules()
18 | {
19 | return [
20 | [['id'], 'required'],
21 | [['refund_reason', 'refund_type'], 'required', 'on' => 'apply'],
22 | [['refund_pay_type', 'refund_money'], 'required', 'on' => 'affirmRefund'],
23 | [['member_express_no', 'member_express_company'], 'required', 'on' => 'salesReturn'],
24 | [['merchant_express_mobile', 'member_express_mobile'], 'string', 'max' => 20],
25 | [['refund_type'], 'integer'],
26 | [['refund_evidence'], 'safe'],
27 | [['refund_apply_money' ,'refund_money'], 'number', 'min' => 0],
28 | [['refund_reason', 'refund_explain', 'member_express_no', 'member_express_company'], 'string', 'max' => 200],
29 | ];
30 | }
31 |
32 | /**
33 | * 场景
34 | *
35 | * @return array
36 | */
37 | public function scenarios()
38 | {
39 | return [
40 | 'default' => array_keys($this->attributeLabels()),
41 | 'apply' => array_keys($this->attributeLabels()),
42 | 'salesReturn' => array_keys($this->attributeLabels()),
43 | 'affirmRefund' => array_keys($this->attributeLabels()),
44 | ];
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/common/forms/OrderSearchForm.php:
--------------------------------------------------------------------------------
1 |
16 | */
17 | class OrderUniteBatchPayFrom extends OrderBatchPayFrom implements PayHandler
18 | {
19 | /**
20 | * 支付金额
21 | *
22 | * @return float
23 | */
24 | public function getTotalFee(): float
25 | {
26 | $payMoney = parent::getTotalFee();
27 |
28 | $member_id = Yii::$app->user->identity->member_id;
29 | $account = Yii::$app->services->memberAccount->findByMemberId($member_id);
30 |
31 | if ($account->user_money >= $payMoney) {
32 | throw new UnprocessableEntityHttpException('请直接使用余额支付');
33 | }
34 |
35 | return BcHelper::sub($payMoney, $account->user_money);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/common/forms/OrderUnitePayFrom.php:
--------------------------------------------------------------------------------
1 |
18 | */
19 | class OrderUnitePayFrom extends OrderPayFrom implements PayHandler
20 | {
21 | /**
22 | * 支付金额
23 | *
24 | * @return float
25 | */
26 | public function getTotalFee(): float
27 | {
28 | $account = Yii::$app->services->memberAccount->findByMemberId($this->order['buyer_id']);
29 |
30 | // 正常支付
31 | if ($account->user_money >= $this->order['pay_money']) {
32 | throw new UnprocessableEntityHttpException('请直接使用余额支付');
33 | }
34 |
35 | return BcHelper::sub($this->order['pay_money'], $account->user_money);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/common/models/common/AdvRecord.php:
--------------------------------------------------------------------------------
1 | 50],
37 | [['device_id'], 'string', 'max' => 64],
38 | ];
39 | }
40 |
41 | /**
42 | * {@inheritdoc}
43 | */
44 | public function attributeLabels()
45 | {
46 | return [
47 | 'id' => '序号',
48 | 'member_id' => '用户id',
49 | 'merchant_id' => '商户id',
50 | 'popup_adv_id' => '弹出广告id',
51 | 'ip' => 'ip地址',
52 | 'device_id' => '设备ID',
53 | 'created_at' => '创建时间',
54 | 'updated_at' => '更新时间',
55 | ];
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/common/models/common/Collect.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class Collect extends Follow
15 | {
16 | use HasOneMerchant;
17 |
18 | /**
19 | * {@inheritdoc}
20 | */
21 | public static function tableName()
22 | {
23 | return '{{%addon_tiny_shop_common_collect}}';
24 | }
25 |
26 | /**
27 | * @return ActiveQuery
28 | */
29 | public function getProduct()
30 | {
31 | return $this->hasOne(Product::class, ['id' => 'topic_id'])
32 | ->select([
33 | 'id',
34 | 'name',
35 | 'picture',
36 | 'star',
37 | 'transmit_num',
38 | 'comment_num',
39 | 'collect_num',
40 | 'view',
41 | 'is_sales_visible',
42 | 'is_stock_visible',
43 | 'status',
44 | ])
45 | ->with('minPriceSku');
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/common/models/common/Follow.php:
--------------------------------------------------------------------------------
1 | 50],
31 | ];
32 | }
33 |
34 | /**
35 | * {@inheritdoc}
36 | */
37 | public function attributeLabels()
38 | {
39 | return [
40 | 'id' => 'ID',
41 | 'merchant_id' => '商户id',
42 | 'member_id' => '用户id',
43 | 'topic_id' => '主题id',
44 | 'topic_type' => '主题类型',
45 | 'status' => '状态[-1:删除;0:禁用;1启用]',
46 | 'created_at' => '创建时间',
47 | 'updated_at' => '修改时间',
48 | ];
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/common/models/common/Nav.php:
--------------------------------------------------------------------------------
1 | 50],
40 | ];
41 | }
42 |
43 | /**
44 | * {@inheritdoc}
45 | */
46 | public function attributeLabels()
47 | {
48 | return [
49 | 'id' => '序号',
50 | 'merchant_id' => '商户id',
51 | 'name' => '标识',
52 | 'data' => '内容',
53 | 'status' => '状态',
54 | 'created_at' => '创建时间',
55 | 'updated_at' => '更新时间',
56 | ];
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/common/models/common/Nice.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class Nice extends Follow
11 | {
12 | /**
13 | * {@inheritdoc}
14 | */
15 | public static function tableName()
16 | {
17 | return '{{%addon_shop_common_nice}}';
18 | }
19 | }
--------------------------------------------------------------------------------
/common/models/common/NotifyPullTime.php:
--------------------------------------------------------------------------------
1 | 20],
37 | ];
38 | }
39 |
40 | /**
41 | * {@inheritdoc}
42 | */
43 | public function attributeLabels()
44 | {
45 | return [
46 | 'id' => 'ID',
47 | 'member_id' => '管理员id',
48 | 'merchant_id' => '商户id',
49 | 'type' => '消息类型[1:公告;2:提醒;3:信息(私信)',
50 | 'alert_type' => '提醒消息类型[sys:系统;wechat:微信]',
51 | 'last_time' => '最后拉取时间',
52 | 'last_id' => '最后拉取ID',
53 | ];
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/common/models/common/NotifySubscriptionConfig.php:
--------------------------------------------------------------------------------
1 | 50],
35 | [['member_id'], 'unique'],
36 | ];
37 | }
38 |
39 | /**
40 | * {@inheritdoc}
41 | */
42 | public function attributeLabels()
43 | {
44 | return [
45 | 'member_id' => '用户id',
46 | 'app_id' => '应用id',
47 | 'action' => '订阅事件',
48 | 'merchant_id' => '商户id',
49 | ];
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/common/models/common/PopupAdvRecord.php:
--------------------------------------------------------------------------------
1 | 50],
37 | [['device_id'], 'string', 'max' => 64],
38 | ];
39 | }
40 |
41 | /**
42 | * {@inheritdoc}
43 | */
44 | public function attributeLabels()
45 | {
46 | return [
47 | 'id' => '序号',
48 | 'member_id' => '用户id',
49 | 'merchant_id' => '商户id',
50 | 'popup_adv_id' => '弹出广告id',
51 | 'ip' => 'ip地址',
52 | 'device_id' => '设备ID',
53 | 'created_at' => '创建时间',
54 | 'updated_at' => '更新时间',
55 | ];
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/common/models/common/Transmit.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class Transmit extends Follow
11 | {
12 | /**
13 | * {@inheritdoc}
14 | */
15 | public static function tableName()
16 | {
17 | return '{{%addon_shop_common_transmit}}';
18 | }
19 | }
--------------------------------------------------------------------------------
/common/models/product/CateMap.php:
--------------------------------------------------------------------------------
1 | '分类id',
41 | 'product_id' => '商品id',
42 | 'merchant_id' => '商户id',
43 | ];
44 | }
45 |
46 | /**
47 | * 关联分类
48 | *
49 | * @return \yii\db\ActiveQuery
50 | */
51 | public function getCate()
52 | {
53 | return $this->hasOne(Cate::class, ['id' => 'cate_id'])->select(['id', 'title']);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/common/models/product/Tag.php:
--------------------------------------------------------------------------------
1 | 50],
38 | [['title'], 'required'],
39 | ];
40 | }
41 |
42 | /**
43 | * {@inheritdoc}
44 | */
45 | public function attributeLabels()
46 | {
47 | return [
48 | 'id' => 'ID',
49 | 'merchant_id' => '商户id',
50 | 'title' => '标签名称',
51 | 'sort' => '排列',
52 | 'status' => '状态',
53 | 'created_at' => '创建时间',
54 | 'updated_at' => '修改时间',
55 | ];
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/common/traits/HasOneProduct.php:
--------------------------------------------------------------------------------
1 | hasOne(Product::class, ['id' => 'product_id'])->select([
21 | 'id',
22 | 'merchant_id',
23 | 'name',
24 | 'sketch',
25 | 'keywords',
26 | 'picture',
27 | 'view',
28 | 'match_point',
29 | 'price',
30 | 'market_price',
31 | 'cost_price',
32 | 'stock',
33 | 'total_sales',
34 | 'shipping_type',
35 | 'delivery_type',
36 | 'is_member_discount',
37 | 'member_discount_type',
38 | 'is_sales_visible',
39 | 'is_stock_visible',
40 | 'is_commission',
41 | 'unit',
42 | 'type',
43 | 'stock_deduction_type',
44 | 'min_buy',
45 | 'max_buy',
46 | 'tags',
47 | 'point_exchange_type',
48 | 'point_give_type',
49 | 'max_use_point',
50 | 'give_point',
51 | 'growth_give_type',
52 | 'give_growth',
53 | 'supplier_id',
54 | 'audit_status',
55 | 'status',
56 | ]);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/common/widgets/link/Link.php:
--------------------------------------------------------------------------------
1 | field($model, 'link')->widget(addons\TinyShop\common\widgets\link\Link::class);
13 | *
14 | * @package addons\TinyShop\common\widgets\link
15 | * @author jianyan74 <751393839@qq.com>
16 | */
17 | class Link extends \yii\widgets\InputWidget
18 | {
19 | /**
20 | * @return string
21 | * @throws \Exception
22 | */
23 | public function run()
24 | {
25 | $value = $this->hasModel() ? Html::getAttributeValue($this->model, $this->attribute) : $this->value;
26 | $name = $this->hasModel() ? Html::getInputName($this->model, $this->attribute) : $this->name;
27 | empty($value) && $value = [];
28 | // 不引入 vue
29 | Yii::$app->params['notRequireVue'] = true;
30 |
31 | return $this->render('index', [
32 | 'value' => Json::encode($value),
33 | 'name' => $name,
34 | 'title' => $value['title'] ?? '',
35 | 'merchant_id' => Yii::$app->services->merchant->getNotNullId()
36 | ]);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/console/controllers/.gitkeep:
--------------------------------------------------------------------------------
1 | *
--------------------------------------------------------------------------------
/console/controllers/OrderController.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class OrderController extends Controller
15 | {
16 | /**
17 | *
18 | */
19 | public function actionRun()
20 | {
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/console/migrations/.gitkeep:
--------------------------------------------------------------------------------
1 | *
--------------------------------------------------------------------------------
/console/migrations/m230619_064744_addon_tiny_shop_common_attribute.php:
--------------------------------------------------------------------------------
1 | execute('SET foreign_key_checks = 0');
11 |
12 | /* 创建表 */
13 | $this->createTable('{{%addon_tiny_shop_common_attribute}}', [
14 | 'id' => "int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '商品属性ID'",
15 | 'merchant_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '商户id'",
16 | 'title' => "varchar(50) NOT NULL DEFAULT '' COMMENT '模型名称'",
17 | 'sort' => "int(11) NULL DEFAULT '999' COMMENT '排序'",
18 | 'status' => "tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态(-1:已删除,0:禁用,1:正常)'",
19 | 'created_at' => "int(10) unsigned NULL DEFAULT '0' COMMENT '创建时间'",
20 | 'updated_at' => "int(10) unsigned NULL DEFAULT '0' COMMENT '修改时间'",
21 | 'PRIMARY KEY (`id`)'
22 | ], "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='扩展_微商城_公用_属性值'");
23 |
24 | /* 索引设置 */
25 |
26 |
27 | /* 表数据 */
28 |
29 | /* 设置外键约束 */
30 | $this->execute('SET foreign_key_checks = 1;');
31 | }
32 |
33 | public function down()
34 | {
35 | $this->execute('SET foreign_key_checks = 0');
36 | /* 删除表 */
37 | $this->dropTable('{{%addon_tiny_shop_common_attribute}}');
38 | $this->execute('SET foreign_key_checks = 1;');
39 | }
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/console/migrations/m230619_064744_addon_tiny_shop_common_nav.php:
--------------------------------------------------------------------------------
1 | execute('SET foreign_key_checks = 0');
11 |
12 | /* 创建表 */
13 | $this->createTable('{{%addon_tiny_shop_common_nav}}', [
14 | 'id' => "int(11) NOT NULL AUTO_INCREMENT COMMENT '序号'",
15 | 'merchant_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '商户id'",
16 | 'type' => "tinyint(4) NULL DEFAULT '3' COMMENT '类型'",
17 | 'name' => "varchar(50) NOT NULL DEFAULT '' COMMENT '标识'",
18 | 'data' => "json NULL COMMENT '内容'",
19 | 'status' => "tinyint(4) NULL DEFAULT '1' COMMENT '状态'",
20 | 'created_at' => "int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间'",
21 | 'updated_at' => "int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间'",
22 | 'PRIMARY KEY (`id`)'
23 | ], "ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='扩展_微商城_导航'");
24 |
25 | /* 索引设置 */
26 |
27 |
28 | /* 表数据 */
29 |
30 | /* 设置外键约束 */
31 | $this->execute('SET foreign_key_checks = 1;');
32 | }
33 |
34 | public function down()
35 | {
36 | $this->execute('SET foreign_key_checks = 0');
37 | /* 删除表 */
38 | $this->dropTable('{{%addon_tiny_shop_common_nav}}');
39 | $this->execute('SET foreign_key_checks = 1;');
40 | }
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/console/migrations/m230619_064744_addon_tiny_shop_common_notify_pull_time.php:
--------------------------------------------------------------------------------
1 | execute('SET foreign_key_checks = 0');
11 |
12 | /* 创建表 */
13 | $this->createTable('{{%addon_tiny_shop_common_notify_pull_time}}', [
14 | 'id' => "int(11) NOT NULL AUTO_INCREMENT",
15 | 'member_id' => "int(10) NOT NULL COMMENT '管理员id'",
16 | 'merchant_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '商户id'",
17 | 'type' => "tinyint(4) NULL DEFAULT '0' COMMENT '消息类型[1:公告;2:提醒;3:信息(私信)'",
18 | 'alert_type' => "varchar(20) NULL DEFAULT '0' COMMENT '提醒消息类型[sys:系统;wechat:微信]'",
19 | 'last_time' => "int(10) NULL COMMENT '最后拉取时间'",
20 | 'last_id' => "int(10) NULL COMMENT '最后拉取ID'",
21 | 'PRIMARY KEY (`id`)'
22 | ], "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统_消息拉取表'");
23 |
24 | /* 索引设置 */
25 |
26 |
27 | /* 表数据 */
28 |
29 | /* 设置外键约束 */
30 | $this->execute('SET foreign_key_checks = 1;');
31 | }
32 |
33 | public function down()
34 | {
35 | $this->execute('SET foreign_key_checks = 0');
36 | /* 删除表 */
37 | $this->dropTable('{{%addon_tiny_shop_common_notify_pull_time}}');
38 | $this->execute('SET foreign_key_checks = 1;');
39 | }
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/console/migrations/m230619_064744_addon_tiny_shop_common_notify_subscription_config.php:
--------------------------------------------------------------------------------
1 | execute('SET foreign_key_checks = 0');
11 |
12 | /* 创建表 */
13 | $this->createTable('{{%addon_tiny_shop_common_notify_subscription_config}}', [
14 | 'member_id' => "int(10) unsigned NOT NULL COMMENT '用户id'",
15 | 'app_id' => "varchar(50) NULL DEFAULT '' COMMENT '应用id'",
16 | 'action' => "json NULL COMMENT '订阅事件'",
17 | 'merchant_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '商户id'",
18 | 'PRIMARY KEY (`member_id`)'
19 | ], "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统_消息配置表'");
20 |
21 | /* 索引设置 */
22 |
23 |
24 | /* 表数据 */
25 |
26 | /* 设置外键约束 */
27 | $this->execute('SET foreign_key_checks = 1;');
28 | }
29 |
30 | public function down()
31 | {
32 | $this->execute('SET foreign_key_checks = 0');
33 | /* 删除表 */
34 | $this->dropTable('{{%addon_tiny_shop_common_notify_subscription_config}}');
35 | $this->execute('SET foreign_key_checks = 1;');
36 | }
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/console/migrations/m230619_064744_addon_tiny_shop_product_cate_map.php:
--------------------------------------------------------------------------------
1 | execute('SET foreign_key_checks = 0');
11 |
12 | /* 创建表 */
13 | $this->createTable('{{%addon_tiny_shop_product_cate_map}}', [
14 | 'cate_id' => "int(10) NULL DEFAULT '0' COMMENT '分类id'",
15 | 'product_id' => "int(10) NULL DEFAULT '0' COMMENT '产品id'",
16 | 'merchant_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '商户id'",
17 | ], "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='扩展_微商城_商品分类关联表'");
18 |
19 | /* 索引设置 */
20 | $this->createIndex('tag_id','{{%addon_tiny_shop_product_cate_map}}','cate_id',0);
21 | $this->createIndex('article_id','{{%addon_tiny_shop_product_cate_map}}','product_id',0);
22 |
23 |
24 | /* 表数据 */
25 |
26 | /* 设置外键约束 */
27 | $this->execute('SET foreign_key_checks = 1;');
28 | }
29 |
30 | public function down()
31 | {
32 | $this->execute('SET foreign_key_checks = 0');
33 | /* 删除表 */
34 | $this->dropTable('{{%addon_tiny_shop_product_cate_map}}');
35 | $this->execute('SET foreign_key_checks = 1;');
36 | }
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/console/migrations/m230619_064744_addon_tiny_shop_product_tag.php:
--------------------------------------------------------------------------------
1 | execute('SET foreign_key_checks = 0');
11 |
12 | /* 创建表 */
13 | $this->createTable('{{%addon_tiny_shop_product_tag}}', [
14 | 'id' => "int(10) unsigned NOT NULL AUTO_INCREMENT",
15 | 'merchant_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '商户id'",
16 | 'title' => "varchar(50) NOT NULL DEFAULT '' COMMENT '标签名称'",
17 | 'sort' => "int(11) NOT NULL DEFAULT '999' COMMENT '排列'",
18 | 'status' => "tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态'",
19 | 'created_at' => "int(10) NULL DEFAULT '0' COMMENT '创建时间'",
20 | 'updated_at' => "int(10) NULL DEFAULT '0' COMMENT '修改时间'",
21 | 'PRIMARY KEY (`id`)'
22 | ], "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='扩展_微商城_商品_标签表'");
23 |
24 | /* 索引设置 */
25 | $this->createIndex('merchant_id','{{%addon_tiny_shop_product_tag}}','merchant_id',0);
26 |
27 |
28 | /* 表数据 */
29 |
30 | /* 设置外键约束 */
31 | $this->execute('SET foreign_key_checks = 1;');
32 | }
33 |
34 | public function down()
35 | {
36 | $this->execute('SET foreign_key_checks = 0');
37 | /* 删除表 */
38 | $this->dropTable('{{%addon_tiny_shop_product_tag}}');
39 | $this->execute('SET foreign_key_checks = 1;');
40 | }
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/docs/guide-zh-CN/start-update-log.md:
--------------------------------------------------------------------------------
1 | ## 更新历史
2 |
3 | ### v3.0.0
4 | updated 2023.8.1
5 |
6 | - 初始化: 3.0 基础
7 |
--------------------------------------------------------------------------------
/frontend/assets/AppAsset.php:
--------------------------------------------------------------------------------
1 | render('index',[
24 |
25 | ]);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/frontend/resources/.gitkeep:
--------------------------------------------------------------------------------
1 | *
--------------------------------------------------------------------------------
/frontend/views/default/index.php:
--------------------------------------------------------------------------------
1 | params['addon']['name'] . ' frontend 页面';
--------------------------------------------------------------------------------
/frontend/views/layouts/main.php:
--------------------------------------------------------------------------------
1 |
9 | beginPage() ?>
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | registerCsrfMetaTags() ?>
21 | = Html::encode($this->title) ?>
22 | head() ?>
23 |
24 |
25 | beginBody() ?>
26 | = $content ?>
27 | endBody() ?>
28 |
29 |
30 | endPage() ?>
31 |
--------------------------------------------------------------------------------
/html5/assets/AppAsset.php:
--------------------------------------------------------------------------------
1 | render('index',[
24 |
25 | ]);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/html5/resources/.gitkeep:
--------------------------------------------------------------------------------
1 | *
--------------------------------------------------------------------------------
/html5/views/default/index.php:
--------------------------------------------------------------------------------
1 | params['addon']['name'] . ' html5 页面';
--------------------------------------------------------------------------------
/html5/views/layouts/main.php:
--------------------------------------------------------------------------------
1 |
9 | beginPage() ?>
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | registerCsrfMetaTags() ?>
21 | = Html::encode($this->title) ?>
22 | head() ?>
23 |
24 |
25 | beginBody() ?>
26 | = $content ?>
27 | endBody() ?>
28 |
29 |
30 | endPage() ?>
31 |
--------------------------------------------------------------------------------
/merchant/assets/AppAsset.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class AppAsset extends AssetBundle
15 | {
16 | /**
17 | * @var string
18 | */
19 | public $sourcePath = '@addons/TinyShop/merchant/resources/';
20 |
21 | public $css = [
22 | 'https://at.alicdn.com/t/font_1681579_ymtux4xwd9.css',
23 | 'css/tinyshop.css',
24 | 'css/font-demo.css',
25 | ];
26 |
27 | public $js = [
28 | 'js/tinyshop.js',
29 | 'js/vuedraggable.min.js',
30 | ];
31 |
32 | public $depends = [
33 | ];
34 | }
35 |
--------------------------------------------------------------------------------
/merchant/controllers/BaseController.php:
--------------------------------------------------------------------------------
1 | request;
23 | $model = new SettingForm();
24 | $model->attributes = Yii::$app->services->addonsConfig->getConfig();
25 | if ($model->load($request->post()) && $model->validate()) {
26 | Yii::$app->services->addonsConfig->setConfig(ArrayHelper::toArray($model));
27 | return $this->message('修改成功', $this->redirect(['display']));
28 | }
29 |
30 | return $this->render('display',[
31 | 'model' => $model,
32 | ]);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/merchant/modules/common/Module.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class Module extends \yii\base\Module
11 | {
12 | /**
13 | * {@inheritdoc}
14 | */
15 | public $controllerNamespace = 'addons\TinyShop\merchant\modules\common\controllers';
16 |
17 | public function init()
18 | {
19 | parent::init();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/merchant/modules/common/controllers/AttributeValueController.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class AttributeValueController extends BaseController
17 | {
18 | /**
19 | * @return array|mixed
20 | */
21 | public function actionList($attribute_id)
22 | {
23 | $data = AttributeValue::find()
24 | ->where([
25 | 'attribute_id' => $attribute_id,
26 | 'status' => StatusEnum::ENABLED
27 | ])
28 | ->orderBy('sort asc')
29 | ->asArray()
30 | ->all();
31 |
32 | foreach ($data as &$datum) {
33 | if ($datum['type'] != AttributeValueTypeEnum::TEXT) {
34 | $datum['value'] = explode(',', $datum['value']);
35 | $datum['data'] = [];
36 | }
37 | }
38 |
39 | return ResultHelper::json(200, 'ok', $data);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/merchant/modules/common/controllers/BaseSettingController.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class BaseSettingController extends BaseController
15 | {
16 | public $modelClass;
17 |
18 | /**
19 | * @return mixed|string
20 | */
21 | public function actionIndex()
22 | {
23 | $request = Yii::$app->request;
24 | $model = new $this->modelClass();
25 | $model->attributes = Yii::$app->services->addonsConfig->getConfig();
26 | if ($model->load($request->post()) && $model->validate()) {
27 | Yii::$app->services->addonsConfig->setConfig(ArrayHelper::toArray($model));
28 |
29 | return $this->message('保存成功', $this->redirect(['index']));
30 | }
31 |
32 | return $this->render('index', [
33 | 'model' => $model,
34 | ]);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/merchant/modules/common/controllers/CopyrightController.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class CopyrightController extends BaseSettingController
13 | {
14 | /**
15 | * @var CopyrightForm
16 | */
17 | public $modelClass = CopyrightForm::class;
18 | }
19 |
--------------------------------------------------------------------------------
/merchant/modules/common/controllers/FontController.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class FontController extends BaseController
13 | {
14 | /**
15 | * @return string
16 | */
17 | public function actionSelector()
18 | {
19 | return $this->render($this->action->id, [
20 |
21 | ]);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/merchant/modules/common/controllers/HotSearchController.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class HotSearchController extends BaseSettingController
13 | {
14 | /**
15 | * @var HotSearchForm
16 | */
17 | public $modelClass = HotSearchForm::class;
18 | }
19 |
--------------------------------------------------------------------------------
/merchant/modules/common/controllers/LocalAreaController.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class LocalAreaController extends BaseController
16 | {
17 | use MerchantCurd;
18 |
19 | /**
20 | * @var LocalArea
21 | */
22 | public $modelClass = LocalArea::class;
23 |
24 | /**
25 | * 编辑/创建
26 | *
27 | * @return mixed
28 | */
29 | public function actionEdit()
30 | {
31 | $model = $this->findModel($this->getMerchantId());
32 | if ($model->load(Yii::$app->request->post()) && $model->save()) {
33 | return $this->message('保存成功', $this->redirect(['edit']));
34 | }
35 |
36 | return $this->render($this->action->id, [
37 | 'model' => $model,
38 | ]);
39 | }
40 |
41 | /**
42 | * 返回模型
43 | *
44 | * @param $id
45 | * @return \yii\db\ActiveRecord
46 | */
47 | protected function findModel($id)
48 | {
49 | /* @var $model \yii\db\ActiveRecord */
50 | if (empty(($model = $this->modelClass::findOne(['merchant_id' => $id])))) {
51 | $model = new $this->modelClass;
52 | return $model->loadDefaultValues();
53 | }
54 |
55 | return $model;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/merchant/modules/common/controllers/MaintenanceController.php:
--------------------------------------------------------------------------------
1 |
12 | */
13 | class MaintenanceController extends BaseSettingController
14 | {
15 | /**
16 | * @var MaintenanceForm
17 | */
18 | public $modelClass = MaintenanceForm::class;
19 | }
20 |
--------------------------------------------------------------------------------
/merchant/modules/common/controllers/ProductAfterSaleExplainController.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class ProductAfterSaleExplainController extends BaseSettingController
13 | {
14 | /**
15 | * @var ProductAfterSaleExplainForm
16 | */
17 | public $modelClass = ProductAfterSaleExplainForm::class;
18 | }
19 |
--------------------------------------------------------------------------------
/merchant/modules/common/controllers/SpecValueController.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class SpecValueController extends BaseController
17 | {
18 | /**
19 | * 创建
20 | *
21 | * @param $title
22 | * @param $type
23 | * @return array|mixed
24 | */
25 | public function actionCreate($title, $spec_id)
26 | {
27 | $model = new SpecValue();
28 | $model = $model->loadDefaultValues();
29 | $model->merchant_id = Yii::$app->services->merchant->getNotNullId();
30 | $model->title = $title;
31 | $model->spec_id = $spec_id;
32 | $model->is_tmp = StatusEnum::ENABLED;
33 | $model->save();
34 |
35 | return ResultHelper::json(200, 'ok', $model);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/merchant/modules/common/forms/AttributeForm.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class AttributeForm extends Attribute
15 | {
16 | public $valueData;
17 |
18 | /**
19 | * @return array
20 | */
21 | public function rules()
22 | {
23 | return ArrayHelper::merge(parent::rules(), [
24 | ['valueData', 'safe']
25 | ]);
26 | }
27 |
28 | /**
29 | * @param bool $insert
30 | * @param array $changedAttributes
31 | * @throws \yii\db\Exception
32 | */
33 | public function afterSave($insert, $changedAttributes)
34 | {
35 | Yii::$app->tinyShopService->attributeValue->updateData($this->valueData, $this->value, $this->id, $this->merchant_id);
36 |
37 | parent::afterSave($insert, $changedAttributes);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/merchant/modules/common/forms/CopyrightForm.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class CopyrightForm extends Model
13 | {
14 | public $copyright_logo;
15 | public $copyright_company_name;
16 | public $copyright_url;
17 | public $copyright_desc;
18 |
19 | public function rules()
20 | {
21 | return [
22 | [['copyright_logo', 'copyright_company_name'], 'string', 'max' => 200,],
23 | [['copyright_url'], 'url'],
24 | [['copyright_desc'], 'string', 'max' => 500],
25 | ];
26 | }
27 |
28 | /**
29 | * @return array|string[]
30 | */
31 | public function attributeLabels()
32 | {
33 | return [
34 | 'copyright_logo' => '版权 logo',
35 | 'copyright_company_name' => '公司名称',
36 | 'copyright_url' => '版权链接',
37 | 'copyright_desc' => '版权信息',
38 | ];
39 | }
40 |
41 | /**
42 | * @return array
43 | */
44 | public function attributeHints()
45 | {
46 | return [
47 | 'copyright_logo' => '建议使用宽 280 像素 - 高 50 像素内的 GIF 或 PNG 透明图片',
48 | ];
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/merchant/modules/common/forms/HotSearchForm.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class HotSearchForm extends Model
13 | {
14 | public $hot_search_default;
15 | public $hot_search_list = [];
16 |
17 | /**
18 | * {@inheritdoc}
19 | */
20 | public function rules()
21 | {
22 | return [
23 | [['hot_search_default'], 'string', 'max' => 100],
24 | [['hot_search_list'], 'safe'],
25 | ];
26 | }
27 |
28 | /**
29 | * @return array
30 | */
31 | public function attributeLabels()
32 | {
33 | return [
34 | 'hot_search_default' => '默认搜索',
35 | 'hot_search_list' => '热门搜索',
36 | ];
37 | }
38 |
39 | /**
40 | * @return array
41 | */
42 | public function attributeHints()
43 | {
44 | return [
45 | 'hot_search_list' => '输入后请回车, 将显示在前台搜索框下面,前台点击时直接作为关键词进行搜索',
46 | 'hot_search_default' => '将显示在前台搜索框,前台点击时直接作为关键词进行搜索',
47 | ];
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/merchant/modules/common/forms/MaintenanceForm.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class MaintenanceForm extends Model
13 | {
14 | public $site_status = 1;
15 | public $site_close_explain;
16 |
17 | public function rules()
18 | {
19 | return [
20 | ['site_status', 'integer'],
21 | [
22 | ['site_close_explain'],
23 | 'string',
24 | 'max' => 200,
25 | ],
26 | ];
27 | }
28 |
29 | /**
30 | * @return array|string[]
31 | */
32 | public function attributeLabels()
33 | {
34 | return [
35 | 'site_status' => '站点状态',
36 | 'site_close_explain' => '站点维护说明',
37 | ];
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/merchant/modules/common/forms/SpecForm.php:
--------------------------------------------------------------------------------
1 | tinyShopService->specValue->updateData($this->valueData, $this->value, $this->id, $this->merchant_id);
32 |
33 | parent::afterSave($insert, $changedAttributes);
34 | }
35 | }
--------------------------------------------------------------------------------
/merchant/modules/common/views/common/_express_nav.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/merchant/modules/common/views/hot-search/index.php:
--------------------------------------------------------------------------------
1 | title = '热门搜索';
7 | $this->params['breadcrumbs'][] = ['label' => $this->title];
8 |
9 | ?>
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 | = $form->field($model, 'hot_search_default')->textInput(); ?>
22 | = $form->field($model, 'hot_search_list')->widget(Select2::class, [
23 | 'options' => [
24 | 'placeholder' => '请填写',
25 | 'multiple' => true,
26 | ],
27 | 'pluginOptions' => [
28 | 'tags' => true,
29 | 'tokenSeparators' => [',', ' '],
30 | 'maximumInputLength' => 20,
31 | ],
32 | ]); ?>
33 |
34 |
35 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/merchant/modules/common/views/maintenance/index.php:
--------------------------------------------------------------------------------
1 | title = '站点维护';
7 | $this->params['breadcrumbs'][] = ['label' => $this->title];
8 |
9 | ?>
10 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
20 | = $form->field($model, 'site_status')->radioList(WhetherEnum::getOpenMap()); ?>
21 | = $form->field($model, 'site_close_explain')->textarea(); ?>
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/merchant/modules/common/views/opinion/ajax-edit.php:
--------------------------------------------------------------------------------
1 | $model->formName(),
9 | 'enableAjaxValidation' => true,
10 | 'validationUrl' => Url::to(['ajax-edit', 'id' => $model['id']]),
11 | 'fieldConfig' => [
12 | 'template' => "{label}
{input}\n{hint}\n{error}
",
13 | ]
14 | ]);
15 | ?>
16 |
17 |
21 |
22 | = $form->field($model, 'reply')->textarea(); ?>
23 |
24 |
28 |
29 |
--------------------------------------------------------------------------------
/merchant/modules/common/views/product-after-sale-explain/index.php:
--------------------------------------------------------------------------------
1 | title = '售后保障';
6 | $this->params['breadcrumbs'][] = ['label' => $this->title];
7 |
8 | ?>
9 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 | = $form->field($model, 'product_after_sale_explain')->widget(\common\widgets\ueditor\UEditor::class, [])->hint('售后保障会在商品详情页面,售后保障切换卡下方展示,内容不超过1500个字符'); ?>
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/merchant/modules/common/views/product-service/ajax-edit.php:
--------------------------------------------------------------------------------
1 | $model->formName(),
10 | 'enableAjaxValidation' => true,
11 | 'validationUrl' => Url::to(['ajax-edit', 'id' => $model['id']]),
12 | 'fieldConfig' => [
13 | 'template' => "{label}
{input}\n{hint}\n{error}
",
14 | ],
15 | ]);
16 |
17 | ?>
18 |
19 |
23 |
24 | = $form->field($model, 'name')->textInput(); ?>
25 | = $form->field($model, 'cover')->widget(Files::class, [
26 | 'config' => [
27 | 'pick' => [
28 | 'multiple' => false,
29 | ]
30 | ]
31 | ]); ?>
32 | = $form->field($model, 'explain')->textarea(); ?>
33 | = $form->field($model, 'sort')->textInput(); ?>
34 | = $form->field($model, 'status')->radioList(StatusEnum::getMap()); ?>
35 |
36 |
40 |
41 |
--------------------------------------------------------------------------------
/merchant/modules/common/views/protocol/index.php:
--------------------------------------------------------------------------------
1 | title = '协议管理';
6 |
7 | ?>
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 | 协议名称 |
21 | 标识 |
22 | 操作 |
23 |
24 |
25 |
26 | $item) {?>
27 |
28 | 《= $item; ?>》 |
29 | = $key; ?> |
30 | = Html::linkButton(['edit', 'name' => $key], '编辑')?> |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/merchant/modules/common/views/spec-template/ajax-edit.php:
--------------------------------------------------------------------------------
1 | $model->formName(),
9 | 'enableAjaxValidation' => true,
10 | 'validationUrl' => Url::to(['ajax-edit', 'id' => $model['id']]),
11 | 'fieldConfig' => [
12 | 'template' => "{label}
{input}\n{hint}\n{error}
",
13 | ]
14 | ]);
15 | ?>
16 |
17 |
21 |
22 | = $form->field($model, 'title')->textInput(); ?>
23 | = $form->field($model, 'sort')->textInput(); ?>
24 | = $form->field($model, 'spec_ids')->checkboxList($specs)->label('关联规格'); ?>
25 | = $form->field($model, 'status')->radioList(StatusEnum::getMap()); ?>
26 |
27 |
31 |
32 |
--------------------------------------------------------------------------------
/merchant/modules/common/views/supplier/ajax-edit.php:
--------------------------------------------------------------------------------
1 | $model->formName(),
9 | 'enableAjaxValidation' => true,
10 | 'validationUrl' => Url::to(['ajax-edit', 'id' => $model['id']]),
11 | 'fieldConfig' => [
12 | 'template' => "{label}
{input}\n{hint}\n{error}
",
13 | ]
14 | ]);
15 | ?>
16 |
17 |
21 |
22 | = $form->field($model, 'name')->textInput(); ?>
23 | = $form->field($model, 'contacts')->textInput(); ?>
24 | = $form->field($model, 'mobile')->textInput(); ?>
25 | = $form->field($model, 'tel_no')->textInput(); ?>
26 | = $form->field($model, 'describe')->textarea(); ?>
27 | = $form->field($model, 'sort')->textInput(); ?>
28 | = $form->field($model, 'status')->radioList(StatusEnum::getMap()); ?>
29 |
30 |
34 |
--------------------------------------------------------------------------------
/merchant/modules/marketing/Module.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class Module extends \yii\base\Module
11 | {
12 | /**
13 | * {@inheritdoc}
14 | */
15 | public $controllerNamespace = 'addons\TinyShop\merchant\modules\marketing\controllers';
16 |
17 | public function init()
18 | {
19 | parent::init();
20 | }
21 | }
--------------------------------------------------------------------------------
/merchant/modules/marketing/controllers/FullMailController.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class FullMailController extends BaseController
15 | {
16 | /**
17 | * 编辑/创建
18 | *
19 | * @return mixed
20 | */
21 | public function actionIndex()
22 | {
23 | /** @var FullMail $model */
24 | $model = Yii::$app->tinyShopService->marketingFullMail->one($this->getMerchantId());
25 | if ($model->load(Yii::$app->request->post()) && $model->save()) {
26 | return $this->message('修改成功', $this->redirect(['index']));
27 | }
28 |
29 | return $this->render($this->action->id, [
30 | 'model' => $model,
31 | ]);
32 | }
33 | }
--------------------------------------------------------------------------------
/merchant/modules/marketing/controllers/PointConfigController.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class PointConfigController extends BaseController
15 | {
16 | /**
17 | * 编辑/创建
18 | *
19 | * @return mixed
20 | */
21 | public function actionIndex()
22 | {
23 | $model = $this->findModel();
24 | if ($model->load(Yii::$app->request->post()) && $model->save()) {
25 | return $this->message('修改成功', $this->redirect(['index']));
26 | }
27 |
28 | return $this->render($this->action->id, [
29 | 'model' => $model,
30 | ]);
31 | }
32 |
33 | /**
34 | * 返回模型
35 | *
36 | * @param $id
37 | * @return \yii\db\ActiveRecord
38 | */
39 | protected function findModel()
40 | {
41 | /* @var $model \yii\db\ActiveRecord */
42 | if (empty(($model = PointConfig::find()->andFilterWhere(['merchant_id' => $this->getMerchantId()])->one()))) {
43 | $model = new PointConfig();
44 |
45 | return $model->loadDefaultValues();
46 | }
47 |
48 | return $model;
49 | }
50 | }
--------------------------------------------------------------------------------
/merchant/modules/marketing/controllers/ProductPosterController.php:
--------------------------------------------------------------------------------
1 |
16 | */
17 | class ProductPosterController extends BaseController
18 | {
19 | /**
20 | * @return string
21 | */
22 | public function actionIndex()
23 | {
24 | $merchantId = Yii::$app->services->merchant->getNotNullId();
25 |
26 | $model = new ProductPosterForm();
27 | $model->attributes = Yii::$app->services->addonsConfig->getConfig('TinyShop', $merchantId);
28 | if ($model->load(Yii::$app->request->post()) && $model->validate()) {
29 | Yii::$app->services->addonsConfig->setConfig(ArrayHelper::toArray($model), 'TinyShop', $merchantId);
30 |
31 | return $this->message('保存成功', $this->redirect(['index']));
32 | }
33 |
34 | return $this->render($this->action->id, [
35 | 'model' => $model,
36 | ]);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/merchant/modules/marketing/forms/CouponTypeGiveForm.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class CouponTypeGiveForm extends Model
13 | {
14 | public $member_id;
15 | public $coupon_type_id;
16 | public $num = 1;
17 | public $title;
18 |
19 | /**
20 | * {@inheritdoc}
21 | */
22 | public function rules()
23 | {
24 | return [
25 | [['num', 'coupon_type_id', 'member_id'], 'required'],
26 | [['num', 'coupon_type_id', 'member_id'], 'integer', 'min' => 1],
27 | [['num'], 'integer', 'max' => 30],
28 | ];
29 | }
30 |
31 | /**
32 | * {@inheritdoc}
33 | */
34 | public function attributeLabels()
35 | {
36 | return [
37 | 'id' => 'ID',
38 | 'num' => '数量',
39 | 'coupon_type_id' => '优惠券',
40 | 'member_id' => '手机号码',
41 | 'title' => '优惠券名称',
42 | ];
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/merchant/modules/marketing/forms/PointExchangeVerifyForm.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class PointExchangeVerifyForm extends Model
13 | {
14 | public $max_buy;
15 | public $marketing_stock;
16 | public $point;
17 | public $discount;
18 |
19 | /**
20 | * @return array
21 | */
22 | public function rules()
23 | {
24 | return [
25 | [['discount', 'point', 'max_buy', 'marketing_stock'], 'required'],
26 | [['max_buy', 'marketing_stock'], 'integer', 'min' => 0],
27 | [['discount'], 'number', 'min' => 0],
28 | [['point'], 'integer', 'min' => 1],
29 | ];
30 | }
31 |
32 | /**
33 | * @return string[]
34 | */
35 | public function attributeLabels()
36 | {
37 | return [
38 | 'discount' => '金额',
39 | 'point' => '积分',
40 | 'marketing_stock' => '库存',
41 | 'max_buy' => '限购',
42 | ];
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/merchant/modules/marketing/forms/ProductPosterForm.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class ProductPosterForm extends Model
15 | {
16 | public $product_poster_cover_type = PosteCoverTypeEnum::ROUNDNESS;
17 | public $product_poster_qr_type = PosteQrTypeEnum::COMMON_QR;
18 | public $product_poster_title = '为你挑选了一个好物';
19 |
20 | /**
21 | * @return array
22 | */
23 | public function rules()
24 | {
25 | return [
26 | [['product_poster_title'], 'required'],
27 | [['product_poster_title', 'product_poster_cover_type'], 'string', 'max' => 20],
28 | [['product_poster_qr_type'], 'string', 'max' => 30],
29 | ];
30 | }
31 |
32 | /**
33 | * @return array|string[]
34 | */
35 | public function attributeLabels()
36 | {
37 | return [
38 | 'product_poster_title' => '推广语',
39 | 'product_poster_cover_type' => '左上角头像显示类型',
40 | 'product_poster_qr_type' => '二维码显示类型',
41 | ];
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/merchant/modules/marketing/views/product-poster/index.php:
--------------------------------------------------------------------------------
1 | title = '商品海报';
8 | $this->params['breadcrumbs'][] = $this->title;
9 | ?>
10 |
11 |
12 |
13 |
14 |
17 | [
19 | 'template' => "
{label}
{input}\n{hint}\n{error}
",
20 | ]
21 | ]); ?>
22 |
23 |
24 | = $form->field($model, 'product_poster_title')->textInput(); ?>
25 | = $form->field($model, 'product_poster_cover_type')->radioList(PosteCoverTypeEnum::getMap()); ?>
26 | = $form->field($model, 'product_poster_qr_type')->radioList(PosteQrTypeEnum::getMap()); ?>
27 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/merchant/modules/order/Module.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class Module extends \yii\base\Module
11 | {
12 | /**
13 | * {@inheritdoc}
14 | */
15 | public $controllerNamespace = 'addons\TinyShop\merchant\modules\order\controllers';
16 |
17 | public function init()
18 | {
19 | parent::init();
20 | }
21 | }
--------------------------------------------------------------------------------
/merchant/modules/order/forms/OrderStoreForm.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class OrderStoreForm extends Store
16 | {
17 | /**
18 | * @return array
19 | */
20 | public function rules()
21 | {
22 | return ArrayHelper::merge(parent::rules(), [
23 | [['buyer_name', 'buyer_mobile'], 'required'],
24 | ['buyer_mobile', 'match', 'pattern' => RegularHelper::mobile(), 'message' => '不是一个有效的手机号码'],
25 | ['buyer_mobile', 'verifyStatus'],
26 | ]);
27 | }
28 |
29 | /**
30 | * @param $attribute
31 | */
32 | public function verifyStatus($attribute)
33 | {
34 | if ($this->pickup_status == StatusEnum::ENABLED) {
35 | $this->addError($attribute, '已经提货成功,请刷新查看');
36 | }
37 | }
38 |
39 | /**
40 | * @param bool $insert
41 | * @return bool
42 | */
43 | public function beforeSave($insert)
44 | {
45 | $this->pickup_status = StatusEnum::ENABLED;
46 | $this->pickup_time = time();
47 |
48 | return parent::beforeSave($insert);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/merchant/modules/order/views/after-sale/company.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
11 |
12 |
13 |
14 |
15 | -
16 |
17 |
= Html::encode($item['remark']) ?>
18 |
19 |
20 | = empty($trace) ? '查不到物流信息' : ''; ?>
21 |
22 |
23 |
24 |
27 |
--------------------------------------------------------------------------------
/merchant/modules/order/views/evaluate/ajax-edit.php:
--------------------------------------------------------------------------------
1 | $model->formName(),
8 | 'enableAjaxValidation' => true,
9 | 'validationUrl' => Url::to(['ajax-edit', 'id' => $model['id']]),
10 | 'fieldConfig' => [
11 | 'template' => "{label}
{input}\n{hint}\n{error}
",
12 | ],
13 | ]);
14 |
15 | ?>
16 |
17 |
21 |
22 |
23 | = $form->field($model, 'again_explain')->textarea(); ?>
24 |
25 | = $form->field($model, 'explain_first')->textarea(); ?>
26 |
27 |
28 |
32 |
33 |
--------------------------------------------------------------------------------
/merchant/modules/order/views/order/_nav.php:
--------------------------------------------------------------------------------
1 | tinyShopService->order->getOrderCountGroupByStatus();
9 | $orderCountGroupByStatus = ArrayHelper::map($orderCountGroupByStatus, 'order_status', 'count');
10 | $orderCountGroupByStatus[OrderStatusEnum::REFUND_ING] = Yii::$app->tinyShopService->order->findAfterSaleCount();
11 |
12 | ?>
13 |
14 |
29 |
--------------------------------------------------------------------------------
/merchant/modules/order/views/order/pickup.php:
--------------------------------------------------------------------------------
1 | $model->formName(),
8 | 'enableAjaxValidation' => true,
9 | 'validationUrl' => Url::to(['pickup','id' => $model['order_id']]),
10 | 'fieldConfig' => [
11 | 'template' => "{label}
{input}\n{hint}\n{error}
",
12 | ]
13 | ]);
14 | ?>
15 |
16 |
20 |
21 | = $form->field($model, 'buyer_name')->textInput(); ?>
22 | = $form->field($model, 'buyer_mobile')->textInput(); ?>
23 | = $form->field($model, 'remark')->textarea(); ?>
24 |
25 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/merchant/modules/order/views/order/seller-memo.php:
--------------------------------------------------------------------------------
1 | $model->formName(),
8 | 'enableAjaxValidation' => true,
9 | 'validationUrl' => Url::to(['seller-memo','id' => $model['id']]),
10 | ]);
11 |
12 | ?>
13 |
14 |
18 |
19 | = $form->field($model, 'seller_memo')->textarea()->label(false); ?>
20 |
21 |
25 |
26 |
--------------------------------------------------------------------------------
/merchant/modules/order/views/product-express/company.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
11 |
12 |
13 |
14 |
15 | -
16 |
17 |
= Html::encode($item['remark']) ?>
18 |
19 |
20 | = empty($trace) ? '查不到物流信息' : ''; ?>
21 |
22 |
23 |
24 |
27 |
--------------------------------------------------------------------------------
/merchant/modules/product/Module.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class Module extends \yii\base\Module
11 | {
12 | /**
13 | * {@inheritdoc}
14 | */
15 | public $controllerNamespace = 'addons\TinyShop\merchant\modules\product\controllers';
16 |
17 | public function init()
18 | {
19 | parent::init();
20 | }
21 | }
--------------------------------------------------------------------------------
/merchant/modules/product/views/brand/ajax-edit.php:
--------------------------------------------------------------------------------
1 | $model->formName(),
9 | 'enableAjaxValidation' => true,
10 | 'validationUrl' => Url::to(['ajax-edit', 'id' => $model['id']]),
11 | 'fieldConfig' => [
12 | 'template' => "{label}
{input}\n{hint}\n{error}
",
13 | ]
14 | ]);
15 | ?>
16 |
17 |
21 |
22 | = $form->field($model, 'title')->textInput(); ?>
23 | = $form->field($model, 'sort')->textInput(); ?>
24 | = $form->field($model, 'cover')->widget(\common\widgets\webuploader\Files::class, [
25 | 'config' => [
26 | 'pick' => [
27 | 'multiple' => false,
28 | ],
29 | ],
30 | ]); ?>
31 | = $form->field($model, 'status')->radioList(StatusEnum::getMap()); ?>
32 |
33 |
37 |
--------------------------------------------------------------------------------
/merchant/modules/product/views/cate/edit.php:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 | = $form->field($model, 'pid')->dropDownList($map, [
10 | 'readonly' => true
11 | ]) ?>
12 | = $form->field($model, 'title')->textInput(); ?>
13 | = $form->field($model, 'subhead')->textInput(); ?>
14 | = $form->field($model, 'sort')->textInput(); ?>
15 | = $form->field($model, 'cover')->widget(\common\widgets\webuploader\Files::class, [
16 | 'type' => 'images',
17 | 'theme' => 'default',
18 | 'themeConfig' => [],
19 | 'config' => [
20 | 'pick' => [
21 | 'multiple' => false,
22 | ],
23 | ],
24 | ])->hint('建议使用 宽100像素 - 高50像素 内的 GIF 或 PNG 透明图片'); ?>
25 | = $form->field($model, 'is_recommend')->checkbox(['1' => '显示']); ?>
26 | = $form->field($model, 'status')->radioList(StatusEnum::getMap()); ?>
27 |
--------------------------------------------------------------------------------
/merchant/modules/product/views/cate/index.php:
--------------------------------------------------------------------------------
1 | title = '商品分类';
8 | $this->params['breadcrumbs'][] = ['label' => $this->title];
9 |
10 | ?>
11 |
12 | = \common\widgets\jstree\JsTreeTable::widget([
13 | 'title' => '商品分类',
14 | 'name' => "userTree",
15 | 'defaultData' => $models,
16 | 'editUrl' => Url::to(['edit']),
17 | 'deleteUrl' => Url::to(['delete']),
18 | 'moveUrl' => Url::to(['move']),
19 | ]) ?>
20 |
--------------------------------------------------------------------------------
/merchant/modules/product/views/tag/ajax-edit.php:
--------------------------------------------------------------------------------
1 | $model->formName(),
9 | 'enableAjaxValidation' => true,
10 | 'validationUrl' => Url::to(['ajax-edit', 'id' => $model['id']]),
11 | 'fieldConfig' => [
12 | 'template' => "{label}
{input}\n{hint}\n{error}
",
13 | ]
14 | ]);
15 | ?>
16 |
17 |
21 |
22 | = $form->field($model, 'title')->textInput(); ?>
23 | = $form->field($model, 'sort')->textInput(); ?>
24 | = $form->field($model, 'status')->radioList(StatusEnum::getMap()); ?>
25 |
26 |
30 |
--------------------------------------------------------------------------------
/merchant/modules/statistics/Module.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class Module extends \yii\base\Module
11 | {
12 | /**
13 | * {@inheritdoc}
14 | */
15 | public $controllerNamespace = 'addons\TinyShop\merchant\modules\statistics\controllers';
16 |
17 | public function init()
18 | {
19 | parent::init();
20 | }
21 | }
--------------------------------------------------------------------------------
/merchant/modules/statistics/controllers/ProductAnalyzeController.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class ProductAnalyzeController extends BaseController
15 | {
16 | /**
17 | * 销售排行榜
18 | *
19 | * @return string
20 | */
21 | public function actionIndex()
22 | {
23 | return $this->render($this->action->id, [
24 | 'models' => Yii::$app->tinyShopService->product->getRank(),
25 | ]);
26 | }
27 |
28 | /**
29 | * 商品构成比率
30 | *
31 | * @return array|mixed
32 | */
33 | public function actionProductType()
34 | {
35 | $data = Yii::$app->tinyShopService->product->getProductTypeStat();
36 |
37 | return ResultHelper::json(200, '获取成功', $data);
38 | }
39 |
40 | /**
41 | * 商品售出分析
42 | */
43 | public function actionSusRes($type = '')
44 | {
45 | if (Yii::$app->request->isAjax) {
46 | $data = Yii::$app->tinyShopService->orderStat->getBetweenProductCountAndCountStatToEchant($type);
47 |
48 | return ResultHelper::json(200, '获取成功', $data);
49 | }
50 |
51 | return $this->render($this->action->id, [
52 | 'total' => Yii::$app->tinyShopService->orderStat->getStatByTime(0),
53 | ]);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/merchant/modules/statistics/controllers/ProductHotController.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class ProductHotController extends BaseController
15 | {
16 | /**
17 | * 商品热卖
18 | *
19 | * 热卖商品金额TOP30
20 | * 热卖商品数量TOP30
21 | */
22 | public function actionIndex()
23 | {
24 | return $this->render($this->action->id, [
25 | ]);
26 | }
27 |
28 | /**
29 | * 下单量
30 | *
31 | * @return array|mixed
32 | */
33 | public function actionCountData()
34 | {
35 | $type = Yii::$app->request->get('type');
36 | $data = Yii::$app->tinyShopService->orderProduct->getMaxCountMoney($type, 30);
37 |
38 | return ResultHelper::json(200, '获取成功', $data);
39 | }
40 |
41 | /**
42 | * 下单金额
43 | *
44 | * @return array|mixed
45 | */
46 | public function actionMoneyData()
47 | {
48 | $type = Yii::$app->request->get('type');
49 | $data = Yii::$app->tinyShopService->orderProduct->getMaxCountMoney($type, 30, 'price');
50 |
51 | return ResultHelper::json(200, '获取成功', $data);
52 | }
53 | }
--------------------------------------------------------------------------------
/merchant/modules/statistics/forms/OrderForm.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class OrderForm extends Order
13 | {
14 | public $count;
15 | }
16 |
--------------------------------------------------------------------------------
/merchant/modules/statistics/views/search/index.php:
--------------------------------------------------------------------------------
1 | title = '搜索分析';
7 | $this->params['breadcrumbs'][] = ['label' => '搜索分析'];
8 | $this->params['breadcrumbs'][] = ['label' => $this->title];
9 |
10 | ?>
11 |
12 |
13 |
14 |
15 |
19 |
20 |
21 | = \common\widgets\echarts\Echarts::widget([
22 | 'theme' => 'wordcloud',
23 | 'config' => [
24 | 'server' => Url::to(['data']),
25 | 'height' => '500px'
26 | ]
27 | ]) ?>
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/merchant/modules/statistics/views/search/record.php:
--------------------------------------------------------------------------------
1 | title = '每日搜索记录';
7 | $this->params['breadcrumbs'][] = ['label' => $this->title];
8 | ?>
9 |
10 |
11 |
12 |
13 |
17 |
18 |
19 | = GridView::widget([
20 | 'dataProvider' => $dataProvider,
21 | 'filterModel' => $searchModel,
22 | //重新定义分页样式
23 | 'tableOptions' => ['class' => 'table table-hover'],
24 | 'columns' => [
25 | [
26 | 'class' => 'yii\grid\SerialColumn',
27 | ],
28 | 'keyword',
29 | 'num',
30 | 'search_date',
31 | ],
32 | ]); ?>
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/merchant/resources/.gitkeep:
--------------------------------------------------------------------------------
1 | *
--------------------------------------------------------------------------------
/merchant/resources/img/bg-mobile-foot-default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/bg-mobile-foot-default.png
--------------------------------------------------------------------------------
/merchant/resources/img/bg_mobile_head_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/bg_mobile_head_default.png
--------------------------------------------------------------------------------
/merchant/resources/img/cate/one_cover.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/cate/one_cover.jpg
--------------------------------------------------------------------------------
/merchant/resources/img/cate/one_product.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/cate/one_product.jpg
--------------------------------------------------------------------------------
/merchant/resources/img/cate/one_two_cover.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/cate/one_two_cover.jpg
--------------------------------------------------------------------------------
/merchant/resources/img/cate/one_two_product.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/cate/one_two_product.jpg
--------------------------------------------------------------------------------
/merchant/resources/img/cate/one_two_text.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/cate/one_two_text.jpg
--------------------------------------------------------------------------------
/merchant/resources/img/cate/one_two_three_cover.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/cate/one_two_three_cover.jpg
--------------------------------------------------------------------------------
/merchant/resources/img/cate/one_two_three_text.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/cate/one_two_three_text.jpg
--------------------------------------------------------------------------------
/merchant/resources/img/member-header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/member-header.png
--------------------------------------------------------------------------------
/merchant/resources/img/mobile_head.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/mobile_head.png
--------------------------------------------------------------------------------
/merchant/resources/img/mobile_head_old.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/mobile_head_old.png
--------------------------------------------------------------------------------
/merchant/resources/img/selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/selected.png
--------------------------------------------------------------------------------
/merchant/resources/img/sku-add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/sku-add.png
--------------------------------------------------------------------------------
/merchant/resources/img/style/black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/style/black.png
--------------------------------------------------------------------------------
/merchant/resources/img/style/blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/style/blue.png
--------------------------------------------------------------------------------
/merchant/resources/img/style/brown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/style/brown.png
--------------------------------------------------------------------------------
/merchant/resources/img/style/green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/style/green.png
--------------------------------------------------------------------------------
/merchant/resources/img/style/orange.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/style/orange.png
--------------------------------------------------------------------------------
/merchant/resources/img/style/pink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/style/pink.png
--------------------------------------------------------------------------------
/merchant/resources/img/style/purple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/style/purple.png
--------------------------------------------------------------------------------
/merchant/resources/img/style/red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/img/style/red.png
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/fonts/element-icons.535877f5.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/fonts/element-icons.535877f5.woff
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/fonts/element-icons.732389de.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/fonts/element-icons.732389de.ttf
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/iconfont.ttf
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/iconfont.woff
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/iconfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/iconfont.woff2
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/img/crack_figure.48d77d7e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/img/crack_figure.48d77d7e.png
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/README.md:
--------------------------------------------------------------------------------
1 | [](https://www.jsdelivr.com/package/npm/tinymce-all-in-one)
2 |
3 | # Why
4 |
5 | Now tinymce's cdn, all plugins are downloaded separately, but there are dozens of plugins. So the init is very slow.
6 | Therefore, this project will build all plugins into `tinymce.min.js`
7 | through [Offical Build](https://www.tiny.cloud/get-tiny/custom-builds/), speeding up the init speed. Didn't do anything
8 | else.
9 |
10 | And
11 |
12 | Currently Tinymce's lang does not have cdn. So create an npm package, let lang supports cdn.
13 |
14 | # Use
15 |
16 | Cnd in [jsdelivr](https://www.jsdelivr.com/package/npm/tinymce-all-in-one)
17 |
18 | **If you don't mind the init speed, it is recommended to use the
19 | official [cdn](https://www.jsdelivr.com/package/npm/tinymce).**
20 |
21 | ## Langs
22 |
23 | Cnd in [jsdelivr](https://www.jsdelivr.com/package/npm/tinymce-lang?path=langs)
24 |
25 | - [zh_CN](https://cdn.jsdelivr.net/npm/tinymce-lang/langs/zh_CN.js)
26 | - [ja](https://cdn.jsdelivr.net/npm/tinymce-lang/langs/ja.js)
27 | - ...
28 |
29 | [support langs](https://www.tiny.cloud/get-tiny/language-packages/)
30 |
31 | ```js
32 | tinymce.init({
33 | selector: "textarea", // change this value according to your HTML
34 | language: "zh_CN", // select language
35 | language_url: "https://cdn.jsdelivr.net/npm/tinymce-lang/langs/zh_CN.js" // site absolute URL
36 | });
37 | ```
38 |
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tinymce-all-in-one",
3 | "version": " 4.9.5",
4 | "description": "Build all tinymce plugins into one js",
5 | "author": "Pan ",
6 | "license": "MIT"
7 | }
8 |
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-cool.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-cool.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-cry.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-cry.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-embarassed.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-embarassed.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-foot-in-mouth.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-foot-in-mouth.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-frown.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-frown.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-innocent.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-innocent.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-kiss.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-kiss.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-laughing.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-laughing.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-money-mouth.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-money-mouth.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-sealed.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-sealed.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-smile.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-smile.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-surprised.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-surprised.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-tongue-out.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-tongue-out.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-undecided.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-undecided.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-wink.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-wink.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-yell.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/emoticons/img/smiley-yell.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/help/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/plugins/help/img/logo.png
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/content.mobile.min.css:
--------------------------------------------------------------------------------
1 | .tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{position:absolute;display:inline-block;background-color:green;opacity:.5}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce-mobile.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce-mobile.woff
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce-small.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce-small.eot
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce-small.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce-small.ttf
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce-small.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce-small.woff
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce.eot
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce.ttf
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/fonts/tinymce.woff
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/img/anchor.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/img/anchor.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/img/loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/img/loader.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/img/object.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/img/object.gif
--------------------------------------------------------------------------------
/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/img/trans.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jianyan74/TinyShop/0c8aaec13ebdbc8348d228b1b9456fc18b323e3b/merchant/resources/plugins/drap/tinymce-all-in-one/skins/lightgray/img/trans.gif
--------------------------------------------------------------------------------
/merchant/views/layouts/main.php:
--------------------------------------------------------------------------------
1 |
9 |
10 | beginPage() ?>
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | registerCsrfMetaTags() ?>
22 | = Html::encode($this->title) ?>
23 | head() ?>
24 |
25 |
26 | beginBody() ?>
27 | = $content ?>
28 | endBody() ?>
29 |
30 |
31 | endPage() ?>
32 |
--------------------------------------------------------------------------------
/oauth2/controllers/DefaultController.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 | class Module extends \yii\base\Module
10 | {
11 | /**
12 | * {@inheritdoc}
13 | */
14 | public $controllerNamespace = 'addons\TinyShop\oauth2\modules\v1\controllers';
15 |
16 | public function init()
17 | {
18 | parent::init();
19 | }
20 | }
--------------------------------------------------------------------------------
/oauth2/modules/v1/controllers/DefaultController.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 | class Module extends \yii\base\Module
10 | {
11 | /**
12 | * {@inheritdoc}
13 | */
14 | public $controllerNamespace = 'addons\TinyShop\oauth2\modules\v2\controllers';
15 |
16 | public function init()
17 | {
18 | parent::init();
19 | }
20 | }
--------------------------------------------------------------------------------
/oauth2/modules/v2/controllers/DefaultController.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class AttributeService
16 | {
17 | /**
18 | * @return array
19 | */
20 | public function getMap()
21 | {
22 | return ArrayHelper::map($this->findAll(), 'id', 'title');
23 | }
24 |
25 | /**
26 | * @return array|\yii\db\ActiveRecord[]
27 | */
28 | public function findAll()
29 | {
30 | return Attribute::find()
31 | ->where(['status' => StatusEnum::ENABLED])
32 | ->andWhere(['merchant_id' => Yii::$app->services->merchant->getNotNullId()])
33 | ->orderBy('sort asc, id desc')
34 | ->asArray()
35 | ->all();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/services/common/CashAgainstAreaService.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class CashAgainstAreaService
13 | {
14 | /**
15 | * @param $merchant_id
16 | * @return array|\yii\db\ActiveRecord|null
17 | */
18 | public function findOne($merchant_id)
19 | {
20 | return CashAgainstArea::find()
21 | ->where(['merchant_id' => $merchant_id])
22 | ->asArray()
23 | ->one();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/services/common/CollectService.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class CollectService extends Service
15 | {
16 | /**
17 | * @param $topic_id
18 | * @param $topic_type
19 | * @param $member_id
20 | * @return Collect|array|\yii\db\ActiveRecord|null
21 | */
22 | public function findByTopicId($topic_id, $topic_type, $member_id)
23 | {
24 | $model = Collect::find()
25 | ->where([
26 | 'topic_id' => $topic_id,
27 | 'topic_type' => $topic_type,
28 | 'member_id' => $member_id,
29 | 'status' => StatusEnum::ENABLED,
30 | ])
31 | ->one();
32 |
33 | return empty($model) ? new Collect() : $model;
34 | }
35 |
36 | /**
37 | * @param $id
38 | * @return array|\yii\db\ActiveRecord|null
39 | */
40 | public function findById($id, $member_id)
41 | {
42 | return Collect::find()
43 | ->where(['id' => $id, 'member_id' => $member_id])
44 | ->one();
45 | }
46 | }
--------------------------------------------------------------------------------
/services/common/HelperService.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class HelperService extends Service
16 | {
17 | /**
18 | * 获取下拉
19 | *
20 | * @param string $id
21 | * @return array
22 | */
23 | public function getDropDownForEdit($id = '')
24 | {
25 | $list = Helper::find()
26 | ->where(['>=', 'status', StatusEnum::DISABLED])
27 | ->andFilterWhere(['<>', 'id', $id])
28 | ->select(['id', 'title', 'pid', 'level'])
29 | ->orderBy('sort asc')
30 | ->asArray()
31 | ->all();
32 |
33 | $models = ArrayHelper::itemsMerge($list);
34 | $data = ArrayHelper::map(ArrayHelper::itemsMergeDropDown($models), 'id', 'title');
35 |
36 | return ArrayHelper::merge([0 => '顶级'], $data);
37 | }
38 |
39 | /**
40 | * @return array|\yii\db\ActiveRecord[]
41 | */
42 | public function findAll()
43 | {
44 | return Helper::find()
45 | ->where(['status' => StatusEnum::ENABLED])
46 | ->select(['id', 'title', 'pid', 'level'])
47 | ->orderBy('sort asc')
48 | ->asArray()
49 | ->all();
50 | }
51 | }
--------------------------------------------------------------------------------
/services/common/LocalAreaService.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class LocalAreaService
13 | {
14 | /**
15 | * @param $merchant_id
16 | * @return array|\yii\db\ActiveRecord|null
17 | */
18 | public function findOne($merchant_id)
19 | {
20 | return LocalArea::find()
21 | ->where(['merchant_id' => $merchant_id])
22 | ->asArray()
23 | ->one();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/services/common/LocalConfigService.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class LocalConfigService
15 | {
16 | /**
17 | * 获取配送费
18 | *
19 | * @param $merchant_id
20 | * @return int
21 | */
22 | public function getShippingFeeByMerchantId($merchant_id, $order_money = 0)
23 | {
24 | if (empty($model = $this->findByMerchantId($merchant_id)) || empty($model->shipping_fee)) {
25 | return 0;
26 | }
27 |
28 | if ($order_money < $model->order_money) {
29 | throw new UnprocessableEntityHttpException('最低配送金额为:' . $model->order_money);
30 | }
31 |
32 | // 运费
33 | $model->shipping_fee = ArrayHelper::arraySort($model->shipping_fee, 'order_money', 'desc');
34 | foreach ($model->shipping_fee as $item) {
35 | if ($order_money > $item['order_money']) {
36 | return $item['freight'];
37 | }
38 | }
39 |
40 | return $model->freight;
41 | }
42 |
43 | /**
44 | * @param $merchant_id
45 | * @return array|\yii\db\ActiveRecord|null
46 | */
47 | public function findByMerchantId($merchant_id = 0)
48 | {
49 | return LocalConfig::find()
50 | ->where(['merchant_id' => $merchant_id])
51 | ->one();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/services/common/NavService.php:
--------------------------------------------------------------------------------
1 | where(['merchant_id' => $merchant_id])
21 | ->asArray()
22 | ->all();
23 | }
24 |
25 | /**
26 | * @return array|\yii\db\ActiveRecord|null
27 | */
28 | public function findOne($merchant_id, $name)
29 | {
30 | return Nav::find()
31 | ->where(['merchant_id' => $merchant_id, 'name' => $name])
32 | ->asArray()
33 | ->one();
34 | }
35 |
36 | /**
37 | * @return Nav
38 | */
39 | public function one($merchant_id, $name)
40 | {
41 | /* @var $model Nav */
42 | if (empty(($model = Nav::find()->where(['merchant_id' => $merchant_id, 'name' => $name])->one()))) {
43 | $model = new Nav();
44 |
45 | return $model->loadDefaultValues();
46 | }
47 |
48 | return $model;
49 | }
50 | }
--------------------------------------------------------------------------------
/services/common/NiceService.php:
--------------------------------------------------------------------------------
1 |
12 | */
13 | class NiceService extends Service
14 | {
15 | /**
16 | * @param $topic_id
17 | * @param $topic_type
18 | * @param $member_id
19 | * @return Nice|array|\yii\db\ActiveRecord|null
20 | */
21 | public function findByTopicId($topic_id, $topic_type, $member_id)
22 | {
23 | $model = Nice::find()
24 | ->where([
25 | 'topic_id' => $topic_id,
26 | 'topic_type' => $topic_type,
27 | 'member_id' => $member_id,
28 | ])
29 | ->andFilterWhere(['merchant_id' => $this->getMerchantId()])
30 | ->one();
31 |
32 | if (!$model) {
33 | $model = new Nice();
34 | }
35 |
36 | return $model;
37 | }
38 |
39 | /**
40 | * @param $id
41 | * @return array|\yii\db\ActiveRecord|null
42 | */
43 | public function findById($id, $member_id)
44 | {
45 | return Nice::find()
46 | ->where(['id' => $id, 'member_id' => $member_id])
47 | ->andFilterWhere(['merchant_id' => $this->getMerchantId()])
48 | ->one();
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/services/common/NotifyAnnounceService.php:
--------------------------------------------------------------------------------
1 | select(['id', 'title', 'cover', 'view', 'synopsis', 'created_at'])
24 | ->where(['status' => StatusEnum::ENABLED])
25 | ->andWhere(['merchant_id' => Yii::$app->services->merchant->getNotNullId()])
26 | ->orderBy('id desc')
27 | ->cache(30)
28 | ->limit(20)
29 | ->asArray()
30 | ->all();
31 | }
32 |
33 | /**
34 | * @return array|\yii\db\ActiveRecord|null
35 | */
36 | public function findById($id)
37 | {
38 | return NotifyAnnounce::find()
39 | ->where(['id' => $id])
40 | ->andWhere(['status' => StatusEnum::ENABLED])
41 | ->one();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/services/common/NotifySubscriptionConfigService.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class NotifySubscriptionConfigService extends Service
16 | {
17 | /**
18 | * @param $app_id
19 | * @param $member_id
20 | * @return NotifySubscriptionConfig|array|\yii\db\ActiveRecord
21 | */
22 | public function findByMemberId($member_id, $merchant_id, $app_id = AppEnum::API)
23 | {
24 | $config = NotifySubscriptionConfig::find()
25 | ->where(['member_id' => $member_id])
26 | ->one();
27 |
28 | if (!$config) {
29 | $config = new NotifySubscriptionConfig();
30 | $config->app_id = $app_id;
31 | $config->merchant_id = $merchant_id;
32 | $config->member_id = $member_id;
33 | $config->action = $this->getAction($app_id);
34 | $config->save();
35 | }
36 |
37 | return $config;
38 | }
39 |
40 | /**
41 | * @param $app_id
42 | * @return array
43 | */
44 | protected function getAction($app_id)
45 | {
46 | switch ($app_id) {
47 | default :
48 | return [
49 | 'all' => StatusEnum::ENABLED,
50 | ];
51 | break;
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/services/common/ProductServiceMapService.php:
--------------------------------------------------------------------------------
1 |
16 | */
17 | class ProductServiceMapService extends Service
18 | {
19 | /**
20 | * @param $merchant_id
21 | */
22 | public function findById($id)
23 | {
24 | return ProductServiceMap::find()
25 | ->where(['id' => $id])
26 | ->andFilterWhere(['merchant_id' => $this->getMerchantId()])
27 | ->one();
28 | }
29 |
30 | /**
31 | * @param $merchant_id
32 | */
33 | public function findByMerchantId($merchant_id)
34 | {
35 | $data = ProductServiceMap::find()
36 | ->where([
37 | 'merchant_id' => $merchant_id,
38 | 'audit_status' => AuditStatusEnum::ENABLED,
39 | 'status' => AuditStatusEnum::ENABLED
40 | ])
41 | ->with(['productService'])
42 | ->asArray()
43 | ->all();
44 |
45 | return ArrayHelper::getColumn($data, 'productService');
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/services/common/SpecTemplateService.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class SpecTemplateService
16 | {
17 | /**
18 | * @return array
19 | */
20 | public function getMap()
21 | {
22 | return ArrayHelper::map($this->findAll(), 'id', 'title');
23 | }
24 |
25 | /**
26 | * @return array|\yii\db\ActiveRecord[]
27 | */
28 | public function findAll()
29 | {
30 | return SpecTemplate::find()
31 | ->where(['status' => StatusEnum::ENABLED])
32 | ->andWhere(['merchant_id' => Yii::$app->services->merchant->getNotNullId()])
33 | ->orderBy('sort asc, id desc')
34 | ->asArray()
35 | ->all();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/services/common/SupplierService.php:
--------------------------------------------------------------------------------
1 | findAll(), 'id', 'name');
23 | }
24 |
25 | /**
26 | * @return array|\yii\db\ActiveRecord[]
27 | */
28 | public function findAll()
29 | {
30 | return Supplier::find()
31 | ->where(['status' => StatusEnum::ENABLED])
32 | ->andWhere(['merchant_id' => Yii::$app->services->merchant->getNotNullId()])
33 | ->orderBy('sort asc, id desc')
34 | ->asArray()
35 | ->all();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/services/common/TransmitService.php:
--------------------------------------------------------------------------------
1 |
12 | */
13 | class TransmitService extends Service
14 | {
15 |
16 | /**
17 | * @param $topic_id
18 | * @param $topic_type
19 | * @param $member_id
20 | * @return Transmit|array|\yii\db\ActiveRecord|null
21 | */
22 | public function findByTopicId($topic_id, $topic_type, $member_id)
23 | {
24 | $model = Transmit::find()
25 | ->where([
26 | 'topic_id' => $topic_id,
27 | 'topic_type' => $topic_type,
28 | 'member_id' => $member_id,
29 | ])
30 | ->andFilterWhere(['merchant_id' => $this->getMerchantId()])
31 | ->one();
32 |
33 | if (!$model) {
34 | $model = new Transmit();
35 | }
36 |
37 | return $model;
38 | }
39 |
40 | /**
41 | * @param $id
42 | * @return array|\yii\db\ActiveRecord|null
43 | */
44 | public function findById($id, $member_id)
45 | {
46 | return Transmit::find()
47 | ->where(['id' => $id, 'member_id' => $member_id])
48 | ->andFilterWhere(['merchant_id' => $this->getMerchantId()])
49 | ->one();
50 | }
51 | }
--------------------------------------------------------------------------------
/services/marketing/MarketingProductSkuService.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class MarketingProductSkuService extends Service
16 | {
17 | /**
18 | * @param $product_id
19 | * @param $sku_id
20 | * @param $marketing_id
21 | * @param $marketing_type
22 | * @return array|ActiveRecord[]|MarketingProductSku
23 | */
24 | public function findByIdAndMarketing(
25 | $product_id,
26 | $sku_id,
27 | $marketing_id,
28 | $marketing_type,
29 | $marketing_product_id = ''
30 | ) {
31 | return MarketingProductSku::find()
32 | ->where(['product_id' => $product_id])
33 | ->andWhere(['in', 'sku_id', [0, $sku_id]])
34 | ->andWhere([
35 | 'marketing_id' => $marketing_id,
36 | 'marketing_type' => $marketing_type,
37 | 'status' => StatusEnum::ENABLED,
38 | 'is_template' => 0,
39 | ])
40 | ->andFilterWhere(['marketing_product_id' => $marketing_product_id])
41 | ->all();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/services/marketing/MarketingStatService.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class MarketingStatService
13 | {
14 | /**
15 | * @param $marketing_id
16 | * @param $marketing_type
17 | * @return void
18 | */
19 | public function create($marketing_id, $marketing_type)
20 | {
21 | $model = new MarketingStat();
22 | $model = $model->loadDefaultValues();
23 | $model->marketing_id = $marketing_id;
24 | $model->marketing_type = $marketing_type;
25 | $model->save();
26 | }
27 |
28 | /**
29 | * @param MarketingStat $marketingStat
30 | * @return void
31 | */
32 | public function updateStat(MarketingStat $marketingStat)
33 | {
34 | MarketingStat::updateAllCounters([
35 | 'total_customer_num' => $marketingStat->total_customer_num,
36 | 'new_customer_num' => $marketingStat->new_customer_num,
37 | 'old_customer_num' => $marketingStat->old_customer_num,
38 | 'pay_money' => $marketingStat->pay_money,
39 | 'order_count' => 1,
40 | 'product_count' => $marketingStat->product_count,
41 | 'discount_money' => $marketingStat->discount_money,
42 | ], [
43 | 'marketing_id' => $marketingStat->marketing_id,
44 | 'marketing_type' => $marketingStat->marketing_type,
45 | ]);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/services/marketing/RechargeConfigService.php:
--------------------------------------------------------------------------------
1 |
12 | */
13 | class RechargeConfigService
14 | {
15 | /**
16 | * @param $money
17 | * @return array|\yii\db\ActiveRecord|null|RechargeConfig
18 | */
19 | public function getGiveMoney($money)
20 | {
21 | return RechargeConfig::find()
22 | ->where(['<=', 'price', $money])
23 | ->andWhere(['status' => StatusEnum::ENABLED])
24 | ->orderBy('price desc')
25 | ->one();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/services/member/MemberService.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class InvoiceService extends Service
17 | {
18 | /**
19 | * @param Order $order
20 | * @param $invoice
21 | * @param $explain
22 | * @return Invoice
23 | * @throws UnprocessableEntityHttpException
24 | */
25 | public function create(Order $order, $invoice, $explain)
26 | {
27 | $model = new Invoice();
28 | $model->attributes = ArrayHelper::toArray($invoice);
29 | $model->merchant_id = $order->merchant_id;
30 | $model->order_id = $order->id;
31 | $model->order_sn = $order->order_sn;
32 | $model->tax_money = $order->tax_money;
33 | $model->explain = $explain;
34 | if (!$model->save()) {
35 | throw new UnprocessableEntityHttpException($this->getError($model));
36 | }
37 |
38 | return $model;
39 | }
40 |
41 | /**
42 | * @param $order_id
43 | * @return array|\yii\db\ActiveRecord|null
44 | */
45 | public function findByOrderId($order_id)
46 | {
47 | return Invoice::find()
48 | ->where(['order_id' => $order_id])
49 | ->one();
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/services/order/MarketingDetailService.php:
--------------------------------------------------------------------------------
1 |
12 | */
13 | class MarketingDetailService extends Service
14 | {
15 | /**
16 | * @param $order_id
17 | * @param array $data
18 | */
19 | public function create($order_id, array $data)
20 | {
21 | foreach ($data as $datum) {
22 | $model = new MarketingDetail();
23 | $model = $model->loadDefaultValues();
24 | $model->attributes = $datum;
25 | $model->order_id = $order_id;
26 | $model->save();
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/services/order/StoreService.php:
--------------------------------------------------------------------------------
1 |
16 | */
17 | class StoreService extends Service
18 | {
19 | /**
20 | * @param $store
21 | * @param Order $order
22 | */
23 | public function create($store, Order $order)
24 | {
25 | $model = new Store();
26 | $model = $model->loadDefaultValues();
27 | $model->attributes = ArrayHelper::toArray($store);
28 | $model->merchant_id = $order->merchant_id;
29 | $model->member_id = $order->buyer_id;
30 | $model->order_id = $order->id;
31 | $model->store_id = $store->id;
32 | $model->pickup_code = StringHelper::random(6, true);
33 | if (!$model->save()) {
34 | throw new UnprocessableEntityHttpException($this->getError($model));
35 | }
36 |
37 | return $model;
38 | }
39 |
40 | /**
41 | * @param $order_id
42 | * @return array|null|\yii\db\ActiveRecord|Order
43 | */
44 | public function findById($order_id)
45 | {
46 | return Store::find()
47 | ->where(['order_id' => $order_id])
48 | ->one();
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/services/product/TagService.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class TagService extends Service
17 | {
18 | /**
19 | * @param $arr
20 | * @return array
21 | */
22 | public function getMapByList($arr)
23 | {
24 | if (empty($arr)) {
25 | return $this->getMap();
26 | }
27 |
28 | $tag = [];
29 | foreach ($arr as $item) {
30 | $tag[$item] = $item;
31 | }
32 |
33 | return ArrayHelper::merge($tag, $this->getMap());
34 | }
35 |
36 | /**
37 | * @return array
38 | */
39 | public function getMap()
40 | {
41 | return ArrayHelper::map($this->findAll(), 'title', 'title');
42 | }
43 |
44 | /**
45 | * @return array|\yii\db\ActiveRecord[]
46 | */
47 | public function findAll()
48 | {
49 | return Tag::find()
50 | ->where(['status' => StatusEnum::ENABLED])
51 | ->andFilterWhere(['merchant_id' => $this->getMerchantId()])
52 | ->orderBy('sort asc, id desc')
53 | ->asArray()
54 | ->all();
55 | }
56 | }
57 |
--------------------------------------------------------------------------------