Browse Source

Merge branch 'phoenix' of ssh://120.24.33.109:11022/hyzjshwo/lanzu_api_hyperf into phoenix

master
weigang 5 years ago
parent
commit
342ecffd3a
  1. 5
      app/Constants/v3/SsdbKeys.php
  2. 11
      app/Controller/v3/ShopCartController.php
  3. 4
      app/Model/v3/SystemConfig.php
  4. 40
      app/Service/v3/Implementations/IntialDeliveryService.php
  5. 3
      app/Service/v3/Implementations/SeparateAccountsService.php
  6. 13
      app/Service/v3/Interfaces/IntialDeliveryServiceInterface.php
  7. 2
      config/autoload/dependencies.php

5
app/Constants/v3/SsdbKeys.php

@ -70,4 +70,9 @@ class SsdbKeys extends AbstractConstants
*/ */
const COUPON_REBATE_LIST = 'coupon_rebate_list_'; const COUPON_REBATE_LIST = 'coupon_rebate_list_';
/**
* @Message("起送价")
*/
const INTIAL_DELIVERY_AMOUNT = 'intial_delivery_amount';
} }

11
app/Controller/v3/ShopCartController.php

@ -3,6 +3,7 @@
namespace App\Controller\v3; namespace App\Controller\v3;
use App\Controller\BaseController; use App\Controller\BaseController;
use App\Service\v3\Interfaces\IntialDeliveryServiceInterface;
use Hyperf\Di\Annotation\Inject; use Hyperf\Di\Annotation\Inject;
use App\Service\v3\Interfaces\ShopCartServiceInterface; use App\Service\v3\Interfaces\ShopCartServiceInterface;
@ -13,12 +14,18 @@ class ShopCartController extends BaseController
* @var ShopCartServiceInterface * @var ShopCartServiceInterface
*/ */
protected $shopCartService; protected $shopCartService;
/**
* @Inject
* @var IntialDeliveryServiceInterface
*/
protected $intialDeliveryService;
public function detail() public function detail()
{ {
$userId = $this->request->input('user_id'); $userId = $this->request->input('user_id');
$marketId = $this->request->input('market_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); // $res['store_lists'] = $this->shopCartService->do($userId,$marketId);

4
app/Model/v3/SystemConfig.php

@ -2,10 +2,10 @@
namespace App\Model\v3; namespace App\Model\v3;
use App\Model\Model;
class SystemConfig extends Model class SystemConfig extends Model
{ {
protected $table = 'ims_cjdc_system_config';
protected $table = 'lanzu_system_config';
public $timestamps = false; public $timestamps = false;
} }

40
app/Service/v3/Implementations/IntialDeliveryService.php

@ -0,0 +1,40 @@
<?php
namespace App\Service\v3\Implementations;
use App\Constants\v3\SsdbKeys;
use App\Model\v3\SystemConfig;
use App\Service\v3\Interfaces\IntialDeliveryServiceInterface;
use Hyperf\Utils\ApplicationContext;
use App\TaskWorker\SSDBTask;
class IntialDeliveryService implements IntialDeliveryServiceInterface
{
public function do()
{
// TODO: Implement do() method.
}
public function check()
{
// TODO: Implement check() method.
}
public function undo()
{
// TODO: Implement undo() method.
}
public function get()
{
$ssdb = ApplicationContext::getContainer()->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;
}
}

3
app/Service/v3/Implementations/SeparateAccountsService.php

@ -10,9 +10,6 @@ use App\Model\v3\Order;
use App\Model\v3\OrderMain; use App\Model\v3\OrderMain;
use App\Model\v3\ServiceReward; use App\Model\v3\ServiceReward;
use App\Model\v3\Store; 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\UserRelationBind;
use App\Model\v3\User; use App\Model\v3\User;
use App\Service\v3\Interfaces\FinancialRecordServiceInterface; use App\Service\v3\Interfaces\FinancialRecordServiceInterface;

13
app/Service/v3/Interfaces/IntialDeliveryServiceInterface.php

@ -0,0 +1,13 @@
<?php
namespace App\Service\v3\Interfaces;
interface IntialDeliveryServiceInterface
{
public function do();
public function check();
public function undo();
public function get();
}

2
config/autoload/dependencies.php

@ -77,7 +77,6 @@ return [
\App\Service\v3\Interfaces\SeparateAccountsServiceInterface::class => \App\Service\v3\Implementations\SeparateAccountsService::class, \App\Service\v3\Interfaces\SeparateAccountsServiceInterface::class => \App\Service\v3\Implementations\SeparateAccountsService::class,
\App\Service\v3\Interfaces\UserServiceInterface::class => \App\Service\v3\Implementations\UserService::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\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\Service\v3\Interfaces\AttachmentServiceInterface::class => \App\Service\v3\Implementations\AttachmentService::class,
\App\JsonRpc\PrintServiceInterface::class => \App\JsonRpc\FeieService::class, \App\JsonRpc\PrintServiceInterface::class => \App\JsonRpc\FeieService::class,
\App\JsonRpc\LocationServiceInterface::class => \App\JsonRpc\LocationService::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\OrderStatisticsServiceInterface::class => \App\Service\v3\Implementations\OrderStatisticsService::class,
\App\Service\v3\Interfaces\UserRelationBindServiceInterface::class => \App\Service\v3\Implementations\UserCommunityBindService::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\BadgeServiceInterface::class => \App\Service\v3\Implementations\BadgeService::class,
\App\Service\v3\Interfaces\IntialDeliveryServiceInterface::class => \App\Service\v3\Implementations\IntialDeliveryService::class,
]; ];
Loading…
Cancel
Save