diff --git a/app/Constants/v3/SsdbKeys.php b/app/Constants/v3/SsdbKeys.php index 137c8f4..d088313 100644 --- a/app/Constants/v3/SsdbKeys.php +++ b/app/Constants/v3/SsdbKeys.php @@ -70,4 +70,9 @@ class SsdbKeys extends AbstractConstants */ const COUPON_REBATE_LIST = 'coupon_rebate_list_'; + /** + * @Message("起送价") + */ + const INTIAL_DELIVERY_AMOUNT = 'intial_delivery_amount'; + } \ No newline at end of file diff --git a/app/Controller/v3/ShopCartController.php b/app/Controller/v3/ShopCartController.php index 6241b15..280c474 100644 --- a/app/Controller/v3/ShopCartController.php +++ b/app/Controller/v3/ShopCartController.php @@ -3,6 +3,7 @@ namespace App\Controller\v3; use App\Controller\BaseController; +use App\Service\v3\Interfaces\IntialDeliveryServiceInterface; use Hyperf\Di\Annotation\Inject; use App\Service\v3\Interfaces\ShopCartServiceInterface; @@ -13,12 +14,18 @@ class ShopCartController extends BaseController * @var ShopCartServiceInterface */ protected $shopCartService; + /** + * @Inject + * @var IntialDeliveryServiceInterface + */ + protected $intialDeliveryService; public function detail() { $userId = $this->request->input('user_id'); $marketId = $this->request->input('market_id'); - - return $this->success($this->shopCartService->allForUser($userId, $marketId)); + $shopcart = $this->shopCartService->allForUser($userId, $marketId); + $shopcart['intial_delivery'] = $this->intialDeliveryService->get(); + return $this->success($shopcart); // //获取购物车商品信息 // $res['store_lists'] = $this->shopCartService->do($userId,$marketId); diff --git a/app/Model/v3/SystemConfig.php b/app/Model/v3/SystemConfig.php index 367f0e8..1b7bf86 100644 --- a/app/Model/v3/SystemConfig.php +++ b/app/Model/v3/SystemConfig.php @@ -2,10 +2,10 @@ namespace App\Model\v3; - +use App\Model\Model; class SystemConfig extends Model { - protected $table = 'ims_cjdc_system_config'; + protected $table = 'lanzu_system_config'; public $timestamps = false; } \ No newline at end of file diff --git a/app/Service/v3/Implementations/IntialDeliveryService.php b/app/Service/v3/Implementations/IntialDeliveryService.php new file mode 100644 index 0000000..5045076 --- /dev/null +++ b/app/Service/v3/Implementations/IntialDeliveryService.php @@ -0,0 +1,40 @@ +get(SSDBTask::class); + $intialDelivery = $ssdb->exec('get',SsdbKeys::INTIAL_DELIVERY_AMOUNT); + if($intialDelivery === false || empty($intialDelivery)) { + $systemConfig = SystemConfig::query()->where('menu_name','initial_delivery_amount')->first(); + $intialDelivery = number_format($systemConfig->value,2); + $ssdb->exec('set',SsdbKeys::INTIAL_DELIVERY_AMOUNT,$intialDelivery); + return $intialDelivery; + } + return $intialDelivery; + } +} \ No newline at end of file diff --git a/app/Service/v3/Implementations/SeparateAccountsService.php b/app/Service/v3/Implementations/SeparateAccountsService.php index 6f9178d..2e5054a 100644 --- a/app/Service/v3/Implementations/SeparateAccountsService.php +++ b/app/Service/v3/Implementations/SeparateAccountsService.php @@ -10,9 +10,6 @@ use App\Model\v3\Order; use App\Model\v3\OrderMain; use App\Model\v3\ServiceReward; use App\Model\v3\Store; -use App\Model\v3\StoreAccount; -use App\Model\v3\SystemConfig; -use App\Model\v3\UserBalance; use App\Model\v3\UserRelationBind; use App\Model\v3\User; use App\Service\v3\Interfaces\FinancialRecordServiceInterface; diff --git a/app/Service/v3/Interfaces/IntialDeliveryServiceInterface.php b/app/Service/v3/Interfaces/IntialDeliveryServiceInterface.php new file mode 100644 index 0000000..bdb48d3 --- /dev/null +++ b/app/Service/v3/Interfaces/IntialDeliveryServiceInterface.php @@ -0,0 +1,13 @@ + \App\Service\v3\Implementations\SeparateAccountsService::class, \App\Service\v3\Interfaces\UserServiceInterface::class => \App\Service\v3\Implementations\UserService::class, \App\Service\v3\Interfaces\CouponRebateServiceInterface::class => \App\Service\v3\Implementations\CouponRebateService::class, - \App\Service\v3\Interfaces\SmsSendServiceInterface::class => \App\Service\v3\Implementations\SmsAliSendService::class, \App\Service\v3\Interfaces\AttachmentServiceInterface::class => \App\Service\v3\Implementations\AttachmentService::class, \App\JsonRpc\PrintServiceInterface::class => \App\JsonRpc\FeieService::class, \App\JsonRpc\LocationServiceInterface::class => \App\JsonRpc\LocationService::class, @@ -85,4 +84,5 @@ return [ \App\Service\v3\Interfaces\OrderStatisticsServiceInterface::class => \App\Service\v3\Implementations\OrderStatisticsService::class, \App\Service\v3\Interfaces\UserRelationBindServiceInterface::class => \App\Service\v3\Implementations\UserCommunityBindService::class, \App\Service\v3\Interfaces\BadgeServiceInterface::class => \App\Service\v3\Implementations\BadgeService::class, + \App\Service\v3\Interfaces\IntialDeliveryServiceInterface::class => \App\Service\v3\Implementations\IntialDeliveryService::class, ];