Commit 009cf7f9 by liwotianname

add stateless

parents 628cc718 67d11e9d
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/29
* Time: 12:03
*/
namespace Hdll\Services\Auth\Enum;
class AuthEnum
{
const SCOPE_BUYER = 1; //买家
const SCOPE_CMAN = 2; //手艺人
const SCOPE_SELLER = 3; //卖家
const SCOPE_ADMIN = 4;//管理员
}
\ No newline at end of file
...@@ -13,6 +13,12 @@ class BargainEnum ...@@ -13,6 +13,12 @@ class BargainEnum
//订单状态 //订单状态
const STATUS_NORMAL = 10; //待支付 const STATUS_NORMAL = 10; //待支付
//paystatus
const HAVE_PAY =2;
const PAY_EXCEPTION = 3;
} }
\ No newline at end of file
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
namespace Hdll\Services\Bargain\Lib; namespace Hdll\Services\Bargain\Lib;
use Hdll\Services\Bargain\Enum\BargainEnum;
use Swoft\Core\ResultInterface; use Swoft\Core\ResultInterface;
/** /**
* The interface of demo service * The interface of demo service
* *
* @method ResultInterface deferGetgoodsinfo( int $limit_id) * @method ResultInterface deferGetgoodsinfo(int $limit_id)
* @method ResultInterface deferGetBargainInfo( int $limit_id) * @method ResultInterface deferGetBargainInfo(int $limit_id)
*/ */
interface BargainInterface interface BargainInterface
{ {
...@@ -25,19 +25,18 @@ interface BargainInterface ...@@ -25,19 +25,18 @@ interface BargainInterface
/** /**
* 获取砍价商品的 商品信息 * 获取砍价商品的 商品信息
* @param int $bargain_id * @param int $bargain_id
* @return { * @return {
"name" 名称 * "name" 名称
"image" 图片 * "image" 图片
"price" 价格 * "price" 价格
"activityName" 活动名称 * "activityName" 活动名称
* } * }
*/ */
public function getGoodsInfo( public function getGoodsInfo(
int $stordId,int $bargain_id int $stordId, int $bargain_id
); );
/** /**
* 通过商品id 获取是否 有砍价活动 * 通过商品id 获取是否 有砍价活动
* @param int $storeId * @param int $storeId
...@@ -45,10 +44,23 @@ interface BargainInterface ...@@ -45,10 +44,23 @@ interface BargainInterface
* @return bool * @return bool
* *
*/ */
public function getBargainInfo( public function getBargainInfo(
int $storeId,int $goodsId int $storeId, int $goodsId
); );
/**
* 支付 状态 回馈接口
* @param string $storeId //
* @param int $bargainbranchId // 砍价活动id
* @param int $status // BargainEnum::HAVE_PAY 成功支付 BargainEnum::PAY_EXCEPTION:未支付 (已经过期或者支付异常)
* @return mixed
*/
public function payStatus(
string $storeId,
int $bargainbranchId,
int $status , //
int $orderId);
} }
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/31
* Time: 17:25
*/
namespace Hdll\Services\Buyer\Enum;
class BillEnum
{
const STATE_BALANCE_FALSE = 1; //未入账
const STATE_BALANCE_TRUE = 2; //已入账
}
\ No newline at end of file
...@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface; ...@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface;
/** /**
* @method ResultInterface deferSaveBill(string $token,int $order_id,int $buyer_id,int $store_id,string $order_sn,int $money) * @method ResultInterface deferSaveBill(string $token,int $order_id,int $buyer_id,int $store_id,string $order_sn,int $money)
* @method ResultInterface deferGetListByOrderId(int $storeId, int $orderId)
* Interface AgencyInterface * Interface AgencyInterface
* @package App\Lib * @package App\Lib
*/ */
...@@ -36,5 +37,18 @@ interface BillInterface{ ...@@ -36,5 +37,18 @@ interface BillInterface{
int $money int $money
); );
public function getListByOrderId(int $storeId, int $orderId);
public function updateByCondition(int $storeId, array $condition, array $info);
/**
* 退款成功逻辑
*
* @param $storeId
* @param $orderId
* @return mixed
*/
public function refundSuccess($storeId, $orderId);
} }
\ No newline at end of file
...@@ -29,7 +29,8 @@ interface BuyerInterface ...@@ -29,7 +29,8 @@ interface BuyerInterface
["storeId"]=>int(0)//店铺id ["storeId"]=>int(0)//店铺id
["referId"]=>int(0)//推荐人ID ["referId"]=>int(0)//推荐人ID
["state"]=>int(0)//买家状态 ["state"]=>int(0)//买家状态
["nickName"]=>string(0) ""买家昵称 ["nickName"]=>string(0) ""//买家昵称
["openId"]=>string(0) ""//买家openId
["profile"]=> ["profile"]=>
array(4) { array(4) {
["realName"]=>string(12) "真实姓名" ["realName"]=>string(12) "真实姓名"
...@@ -56,11 +57,11 @@ interface BuyerInterface ...@@ -56,11 +57,11 @@ interface BuyerInterface
"phoneNumber" => "手机号", "phoneNumber" => "手机号",
"birthday" => "生日" "birthday" => "生日"
]; ];
* @param string $token * @param int $storeId
* @param array $data * @param array $data
* @return mixed * @return mixed
*/ */
public function updateProfile(string $token, array $data); public function updateProfile(int $storeId, array $data);
/** /**
* 是否已经注册用户 * 是否已经注册用户
......
...@@ -22,10 +22,9 @@ interface CommissionInterface ...@@ -22,10 +22,9 @@ interface CommissionInterface
* @return bool * @return bool
*/ */
public function reduceBalanceCommission($storeId, $buyerId, $money); public function reduceBalanceCommission($storeId, $buyerId, $money);
/** /**
* 增加可提现金额 * 增加可提现金额
* *
* @param $storeId * @param $storeId
* @param $buyerId * @param $buyerId
* @param $money * @param $money
...@@ -34,6 +33,16 @@ interface CommissionInterface ...@@ -34,6 +33,16 @@ interface CommissionInterface
public function addBalanceCommission($storeId, $buyerId, $money); public function addBalanceCommission($storeId, $buyerId, $money);
/** /**
* 增加可提现金额(仅限于对账服务使用,切记!!!)
*
* @param $storeId
* @param $buyerId
* @param $money
* @return bool
*/
public function addBalanceCommissionCompare($storeId, $buyerId, $money);
/**
* 增加累计现金额 * 增加累计现金额
* *
* @param $storeId * @param $storeId
...@@ -43,4 +52,13 @@ interface CommissionInterface ...@@ -43,4 +52,13 @@ interface CommissionInterface
*/ */
public function addTotalCommission($storeId, $buyerId, $money); public function addTotalCommission($storeId, $buyerId, $money);
/**
* 增加冻结金额
*
* @param int $storeId
* @param int $orderId
* @return mixed
*/
public function addExpectCommission(int $storeId, int $orderId);
} }
\ No newline at end of file
...@@ -90,7 +90,6 @@ class CommonEntity extends Model ...@@ -90,7 +90,6 @@ class CommonEntity extends Model
} }
$request = RequestContext::getRequest(); $request = RequestContext::getRequest();
$testFlag = $request->query('flag');
//获取注解里的table //获取注解里的table
$res = new \ReflectionClass(static::class); $res = new \ReflectionClass(static::class);
......
...@@ -39,10 +39,8 @@ class Alisms ...@@ -39,10 +39,8 @@ class Alisms
// 短信模板预设参数 // 短信模板预设参数
$this->templateParam = $templateParam; $this->templateParam = $templateParam;
$configurator = \Swoft\App::getBean('config'); $commonConfigs = include dirname(__FILE__, 2).'/Config/config.php';
$configurator->load('@vendor/hdll/services/src/Common/Config'); $this->config = $commonConfigs['alisms'];
$this->config = $configurator->get('alisms');
} }
/** /**
......
...@@ -12,14 +12,31 @@ use Swoft\Redis\Operator\Processor\PrefixProcessor; ...@@ -12,14 +12,31 @@ use Swoft\Redis\Operator\Processor\PrefixProcessor;
class Redis extends \Swoft\Redis\Redis class Redis extends \Swoft\Redis\Redis
{ {
private $prefix;
/** /**
* 设置redis前缀 * 设置redis前缀
* @param $prefix * @param $prefix
*/ */
public function setPrefix($prefix) public function setPrefix($prefix)
{ {
$this->prefix = $prefix;
}
public function call(string $method, array $params)
{
$config = App::getBean(PrefixProcessor::class); $config = App::getBean(PrefixProcessor::class);
$config->setPrefix($prefix); $config->setPrefix($this->prefix);
$res = parent::call($method, $params);
$config->setPrefix(config("redis.prefix",''));
return $res;
}
public function __destruct()
{
$config = App::getBean(PrefixProcessor::class);
$config->setPrefix(config("redis.prefix",''));
} }
......
...@@ -53,7 +53,7 @@ class Smscode ...@@ -53,7 +53,7 @@ class Smscode
} else { } else {
$count = 1; $count = 1;
} }
$vcode = mt_rand(10000, 99999); $vcode = mt_rand(1000, 9999);
$alisms = new Alisms( $alisms = new Alisms(
$signName ?? Alisms::SN_01, $signName ?? Alisms::SN_01,
$templateCode ?? Alisms::TPL_01, $templateCode ?? Alisms::TPL_01,
......
...@@ -26,10 +26,8 @@ class Upload ...@@ -26,10 +26,8 @@ class Upload
public function __construct(array $config = []) public function __construct(array $config = [])
{ {
if (empty($config)) { if (empty($config)) {
/**@var Config */ $config = include alias('@vendor/hdll/services/src/Common/Config').'/config.php';
$bConfig = \Swoft\App::getBean('config'); $config = $config['qCloud'];
$bConfig->load('@vendor/hdll/services/src/Common/Config');
$config = $bConfig->get('qCloud');
} }
$this->Bucket = $config['Bucket']; $this->Bucket = $config['Bucket'];
$this->Region = $config['Region']; $this->Region = $config['Region'];
...@@ -68,4 +66,27 @@ class Upload ...@@ -68,4 +66,27 @@ class Upload
} }
return $result; return $result;
} }
public function uploadStream($stream, $name = '')
{
$cosClient = new Client(
[
'region' => $this->Region,
'credentials' => [
'secretId' => $this->SecretId,
'secretKey' => $this->SecretKey,
]
]
);
try {
$result = $cosClient->Upload(
$this->Bucket,
$name,
$stream
);
} catch (\Exception $e) {
throw new CommonException(['msg' => $e->getMessage()]);
}
return $result;
}
} }
\ No newline at end of file
...@@ -25,7 +25,7 @@ class AuthPoolConfig extends PoolProperties ...@@ -25,7 +25,7 @@ class AuthPoolConfig extends PoolProperties
public function __construct() public function __construct()
{ {
// 区别本地和线上的RPC服务地址 // 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', 'auth:8099')); $this->uri = explode(',', env('RPC_AUTH_URI', 'auth:8099'));
} }
......
...@@ -21,13 +21,21 @@ use Swoft\Bean\Annotation\Value; ...@@ -21,13 +21,21 @@ use Swoft\Bean\Annotation\Value;
class BargainPoolConfig extends PoolProperties class BargainPoolConfig extends PoolProperties
{ {
<<<<<<< HEAD
=======
>>>>>>> 67d11e9d1c40be5b86a0d76e64c27c95b7f7be07
public function __construct() public function __construct()
{ {
// 区别本地和线上的RPC服务地址 // 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_BARGAIN_URI', 'bargain:8099')); $this->uri = explode(',', env('RPC_BARGAIN_URI', 'bargain:8099'));
<<<<<<< HEAD
} }
=======
}
>>>>>>> 67d11e9d1c40be5b86a0d76e64c27c95b7f7be07
protected $name = 'bargain'; protected $name = 'bargain';
/** /**
......
...@@ -25,7 +25,7 @@ class BuyerPoolConfig extends PoolProperties ...@@ -25,7 +25,7 @@ class BuyerPoolConfig extends PoolProperties
public function __construct() public function __construct()
{ {
// 区别本地和线上的RPC服务地址 // 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', 'buyer:8099')); $this->uri = explode(',', env('RPC_BUYER_URI', 'buyer:8099'));
} }
/** /**
......
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Bean\Annotation\Value;
use Swoft\Pool\PoolProperties;
/**
* the config of service user
*
* @Bean()
*/
class NoticePoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_NOTICE_URI', 'notice:8099'));
}
/**
* the name of pool
*
*/
protected $name = 'pay';
/**
* Minimum active number of connections
*
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
*/
protected $maxActive = 50;
/**
* the maximum number of wait connections
*
*/
protected $maxWait = 100;
/**
* Maximum waiting time
*
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
*/
protected $timeout = 50;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
*/
protected $uri = [
"192.168.3.100:8102",
];
/**
* whether to user provider(consul/etcd/zookeeper)
*
*/
protected $useProvider = false;
/**
* the default balancer is random balancer
*
*/
protected $balancer = '';
/**
* the default provider is consul provider
*
*/
protected $provider = '';
}
...@@ -22,7 +22,7 @@ class OrderPoolConfig extends PoolProperties ...@@ -22,7 +22,7 @@ class OrderPoolConfig extends PoolProperties
public function __construct() public function __construct()
{ {
// 区别本地和线上的RPC服务地址 // 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', 'order:8099')); $this->uri = explode(',', env('RPC_ORDER_URI', 'order:8099'));
} }
...@@ -68,7 +68,7 @@ class OrderPoolConfig extends PoolProperties ...@@ -68,7 +68,7 @@ class OrderPoolConfig extends PoolProperties
* *
* @var int * @var int
*/ */
protected $timeout = 5; protected $timeout = 200;
/** /**
* the addresses of connection * the addresses of connection
......
...@@ -21,12 +21,12 @@ use Swoft\Pool\PoolProperties; ...@@ -21,12 +21,12 @@ use Swoft\Pool\PoolProperties;
*/ */
class PayPoolConfig extends PoolProperties class PayPoolConfig extends PoolProperties
{ {
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', 'pay:8099'));
}
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_PAY_URI', 'pay:8099'));
}
/** /**
* the name of pool * the name of pool
* *
...@@ -67,7 +67,7 @@ class PayPoolConfig extends PoolProperties ...@@ -67,7 +67,7 @@ class PayPoolConfig extends PoolProperties
* the time of connect timeout * the time of connect timeout
* *
*/ */
protected $timeout = 5; protected $timeout = 50;
/** /**
* the addresses of connection * the addresses of connection
...@@ -81,7 +81,7 @@ class PayPoolConfig extends PoolProperties ...@@ -81,7 +81,7 @@ class PayPoolConfig extends PoolProperties
* *
*/ */
protected $uri = [ protected $uri = [
"pay:8099", "192.168.3.100:8102",
]; ];
/** /**
......
...@@ -68,7 +68,7 @@ class ReservationPoolConfig extends PoolProperties ...@@ -68,7 +68,7 @@ class ReservationPoolConfig extends PoolProperties
* *
* @var int * @var int
*/ */
protected $timeout = 5; protected $timeout = 15;
/** /**
* the addresses of connection * the addresses of connection
......
...@@ -68,7 +68,7 @@ class SchedulePoolConfig extends PoolProperties ...@@ -68,7 +68,7 @@ class SchedulePoolConfig extends PoolProperties
* *
* @var int * @var int
*/ */
protected $timeout = 5; protected $timeout = 15;
/** /**
* the addresses of connection * the addresses of connection
......
...@@ -84,8 +84,7 @@ class SellerPoolConfig extends PoolProperties ...@@ -84,8 +84,7 @@ class SellerPoolConfig extends PoolProperties
* @var array * @var array
*/ */
protected $uri = [ protected $uri = [
"172.21.0.46:8099", '192.168.3.39:8099'
// "seller:8099"
]; ];
/** /**
......
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Pool\PoolProperties;
use Swoft\Bean\Annotation\Value;
/**
* @Bean()
* the config of service bargain
*/
class StateLessPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_STATELESS_URI', 'stateless:8399'));
}
protected $name = 'stateless';
/**
* Minimum active number of connections
*
* @var int
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
* @var int
*/
protected $maxActive = 50;
/**
* the maximum number of wait connections
*
* @var int
*/
protected $maxWait = 100;
/**
* Maximum waiting time
*
* @var int
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
* @var int
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
* @var int
*/
protected $timeout = 5;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
* @Value(name="", env="${RPC_BARGAIN_URI}")
* @var array
*/
protected $uri = [
'172.21.0.34:8099',
'172.16.255.241:8099',
];
/**
* whether to user provider(consul/etcd/zookeeper)
*
* @var bool
*/
protected $useProvider = false;
/**
* the default balancer is random balancer
*
* @var string
*/
protected $balancer = '';
/**
* the default provider is consul provider
*
* @var string
*/
protected $provider = '';
}
...@@ -68,7 +68,7 @@ class StorePoolConfig extends PoolProperties ...@@ -68,7 +68,7 @@ class StorePoolConfig extends PoolProperties
* *
* @var int * @var int
*/ */
protected $timeout = 5; protected $timeout = 15;
/** /**
* the addresses of connection * the addresses of connection
......
...@@ -22,9 +22,16 @@ class TimeLimitBuyPoolConfig extends PoolProperties ...@@ -22,9 +22,16 @@ class TimeLimitBuyPoolConfig extends PoolProperties
public function __construct() public function __construct()
{ {
// 区别本地和线上的RPC服务地址 // 区别本地和线上的RPC服务地址
<<<<<<< HEAD
$this->uri = explode(',', env('RPC_TIMELIMITBUY_URI', 'timelistbuy:8099')); $this->uri = explode(',', env('RPC_TIMELIMITBUY_URI', 'timelistbuy:8099'));
} }
protected $name = 'timelimitname'; protected $name = 'timelimitname';
=======
$this->uri = explode(',', env('RPC_TIMELIMITBUY_URI', 'timelimitbuy:8099'));
}
protected $name = 'bargain';
>>>>>>> 67d11e9d1c40be5b86a0d76e64c27c95b7f7be07
/** /**
* Minimum active number of connections * Minimum active number of connections
......
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Pool\PoolProperties;
/**
* the config of service WithdrawCash
*
* @Bean()
*/
class TransferPoolConfig extends PoolProperties
{
public function __construct()
{
$this->uri=explode(',',env('RPC_TRANSFER_URI','transfer:8099'));
}
protected $name = 'transfer';
/**
* Minimum active number of connections
*
* @var int
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
* @var int
*/
protected $maxActive = 50;
/**
* the maximum number of wait connections
*
* @var int
*/
protected $maxWait = 100;
/**
* Maximum waiting time
*
* @var int
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
* @var int
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
* @var int
*/
protected $timeout = 5;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
* @var array
*/
protected $uri = [];
/**
* whether to user provider(consul/etcd/zookeeper)
*
* @var bool
*/
protected $useProvider = false;
/**
* the default balancer is random balancer
*
* @var string
*/
protected $balancer = '';
/**
* the default provider is consul provider
*
* @var string
*/
protected $provider = '';
}
...@@ -12,6 +12,9 @@ use Swoft\Core\ResultInterface; ...@@ -12,6 +12,9 @@ use Swoft\Core\ResultInterface;
/** /**
* @method ResultInterface deferGet($storeId, $id) * @method ResultInterface deferGet($storeId, $id)
* @method ResultInterface deferIncSales($storeId, $goodsId)
* @method ResultInterface deferDecSales($storeId, $goodsId)
* @method ResultInterface deferGetServiceByGoodsId($storeId, $goodsId)
* Interface GoodsInterface * Interface GoodsInterface
* @package Hdll\Services\Goods\Lib * @package Hdll\Services\Goods\Lib
*/ */
...@@ -39,4 +42,34 @@ interface GoodsInterface ...@@ -39,4 +42,34 @@ interface GoodsInterface
*/ */
public function get($storeId, $id); public function get($storeId, $id);
/**
* 增加商品销量
* 减少商品库存
* @param $storeId
* @param $goodsId
* @return mixed
* @author Administrator
*/
public function incSales($storeId, $goodsId);
/**
* 减少商品销量
* 增加商品库存
* @param $storeId
* @param $goodsId
* @return mixed
* @author Administrator
*/
public function decSales($storeId, $goodsId);
/**
* 获取商品服务
* @param $storeId
* @param $goodsId
* @return mixed
* @author Administrator
*/
public function getServiceByGoodsId($storeId,$goodsId);
} }
\ No newline at end of file
...@@ -19,8 +19,18 @@ use Swoft\Core\ResultInterface; ...@@ -19,8 +19,18 @@ use Swoft\Core\ResultInterface;
interface GroupBookingInterface{ interface GroupBookingInterface{
public function paySuccess($orderId); public function paySuccess($orderId,$storeId);
public function hasActivity($storeId,$goodsId); public function hasActivity($storeId,$goodsId);
/**
* 关闭拼团
* @param $storeId
* @param $buyerId
* @param $orderId
* @return mixed
* @author Administrator
*/
public function closeRecord($storeId, $buyerId, $orderId);
} }
\ No newline at end of file
...@@ -14,8 +14,4 @@ class LimitTimeBuyEnum ...@@ -14,8 +14,4 @@ class LimitTimeBuyEnum
//订单状态 //订单状态
const STATUS_NORMAL = 10; //待支付 const STATUS_NORMAL = 10; //待支付
} }
\ No newline at end of file
<?php
namespace Hdll\Services\LimitTimeBuy\Enum;
class LimitTimeOrderEnum
{
//订单状态
const STATUS_NORMAL = 1; //待支付 1未支付2已经支付3异常
const STATUS_HAVE_PAY =2;
const STATUS_PAY_EXCEPTION =3;
}
\ No newline at end of file
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
namespace Hdll\Services\LimitTimeBuy\Lib; namespace Hdll\Services\LimitTimeBuy\Lib;
use Hdll\Services\LimitTimeBuy\Enum\LimitTimeOrderEnum;
use Swoft\Core\ResultInterface; use Swoft\Core\ResultInterface;
/** /**
...@@ -44,10 +45,10 @@ interface LimitTimeBuyInterface ...@@ -44,10 +45,10 @@ interface LimitTimeBuyInterface
* 获取限时购商品的 商品信息 * 获取限时购商品的 商品信息
* @param int $limit_id * @param int $limit_id
* @return { * @return {
"name" 名称 * "name" 名称
"image" 图片 * "image" 图片
"price" 价格 * "price" 价格
"activityName" 活动名称 * "activityName" 活动名称
* } * }
*/ */
public function getLimitGoods( public function getLimitGoods(
...@@ -66,4 +67,18 @@ interface LimitTimeBuyInterface ...@@ -66,4 +67,18 @@ interface LimitTimeBuyInterface
); );
/**
* 支付 状态 回馈接口
* @param string $store_id
* @param int $limit_id
* @param int $status // 2.LimitTimeOrderEnum::STATUS_HAVE_PAY 成功支付 3:LimitTimeOrderEnum::STATUS_PAY_EXCEPTION 未支付 (已经过期或者支付异常)
* @param int $orderId
* @return bool|mixed
* @throws ConException
*/
public function payStatus(
string $store_id,
int $limit_id,
int $status,
int $orderId);
} }
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/9/4
* Time: 10:46
*/
namespace Hdll\Services\Notice\Common;
class WxMiniNotice
{
/**
* 微信小程序page生成
*
* 用法:
* WxMiniNotice::generatePage("pages/orderShow/orderShow",['orderId' => $orderInfo['id'], 'storeId' => $orderInfo['storeId']])
* 生成
* pages/orderShow/orderShow?orderId=1&storeId=7
* @param string $page
* @param array $param
* @return string
*/
public static function generatePage(string $page, array $param)
{
$param['origin'] = $param['origin']??'notice';
$param = http_build_query($param);
return $page.'?'.$param;
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 11:09
*/
namespace Hdll\Services\Notice\Enum;
class FormIdEnum
{
const TYPE_FORM = 1;
const TYPE_PAY = 2;
}
\ No newline at end of file
...@@ -7,18 +7,26 @@ ...@@ -7,18 +7,26 @@
*/ */
namespace Hdll\Services\Notice\Enum; namespace Hdll\Services\Notice\Enum;
class NoticeEnum class NoticeEnum
{ {
const WX_SEND = 1; //商家小程序发送
const TYPE_MINI_BACKEND_SEND= 100;
const SMS_SEND = 2; //腾讯sms发送
const TYPE_TENCENT_SMS = 150;
//买家小程序消息推送
const TYPE_MINI_FRONTEND_SEND= 101;
const SEND_TYPES = [
self::WX_SEND,
self::SMS_SEND
const SEND_TYPES = [
self::TYPE_MINI_BACKEND_SEND,
self::TYPE_TENCENT_SMS,
self::TYPE_MINI_FRONTEND_SEND
]; ];
} }
\ No newline at end of file
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Notice\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of demo service
*
* @method ResultInterface deferSend(int $storeId, array $sendTypes, array $data, int $sendTime) :bool
*/
interface NoticeInterface
{
/**
* 参数说明
*
* 微信发送消息数据结构
* $data[NoticeEnum::TYPE_MINI_BACKEND_SEND] = [
"uid" => 1, //用户的id
* "storeId" => 1, //店铺id
"template_id" => "1kZ_RkkWfRrpufXNdmJYBpIhgk7ccCtPrypeJQ9WRwM",//消息模板id
"page" => "index", //消息模板页面
"data" => [ //消息模板数据
"keyword1" => [
"value" => "商品名称",
],
"keyword2" => [
"value" => "A8204427546131350100",
],
"keyword3" => [
"value" => "¥30",
],
"keyword4" => [
"value" => date('Y-m-d'),
]
]
];
*
* 短信发送消息数据结构
$data[NoticeEnum::TYPE_TENCENT_SMS] = [
[
"templateId" => "178822", //模板id
"phoneNumber" => "17558430002",
"param" => [ //模板变量名
"1580",
"5"
]
]
];
*
* @param array $sendTypes
* @param array $data
* @param int $sendTime //发送时间,立即返送填0
* @return mixed
*/
public function send(array $sendTypes, array $data, int $sendTime) :bool;
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/23
* Time: 13:42
*/
namespace Hdll\Services\Order\Enum;
class ConsigneeEnum
{
const DEFAULT_ENABLE = 1;
const DEFAULT_DISABLE = 0;
const DEFAULT_ALLOW_VALUE = [
self::DEFAULT_DISABLE,
self::DEFAULT_ENABLE
];
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 15:28
*/
namespace Hdll\Services\Order\Enum;
class OrderCate
{
const TYPE_BUYER = 1;
const TYPE_SELLER = 2;
}
\ No newline at end of file
...@@ -21,20 +21,39 @@ class OrderEnum ...@@ -21,20 +21,39 @@ class OrderEnum
const STATUS_CANCEL = 0; //已取消 const STATUS_CANCEL = 0; //已取消
const STATUS_CLOSED = 70; //已关闭 const STATUS_CLOSED = 70; //已关闭
const STATUS_REFUNDING = 80; //退款中 const STATUS_REFUNDING = 80; //退款中
const STATUS_EVALUATION = 90; //已评价
const STATUS_COLLECTION = 100; //团购进行中
//订单类型 //订单类型
const TYPE_GOODS = 0; //商品订单 const TYPE_GOODS = 0; //商品订单
const TYPE_CUT_PRICE = 1; //砍价订单 const TYPE_CUT_PRICE = 1; //砍价订单
const TYPE_LIMIT = 2; //限时购订单 const TYPE_LIMIT = 2; //限时购订单
const TYPE_COLLECTION = 3; //拼团 const TYPE_COLLECTION = 3; //拼团
const TYPE_VALUE_ADDED_SERVICE = 4; //增值服务
const ORDER_TYPES = [ const ORDER_TYPES = [
self::TYPE_GOODS, self::TYPE_GOODS,
self::TYPE_CUT_PRICE, self::TYPE_CUT_PRICE,
self::TYPE_LIMIT, self::TYPE_LIMIT,
self::TYPE_COLLECTION, self::TYPE_COLLECTION,
self::TYPE_VALUE_ADDED_SERVICE, ];
//可以直接预约的订单类型
const CAN_RESERVE = [
self::TYPE_GOODS,
self::TYPE_CUT_PRICE,
self::TYPE_LIMIT,
];
const PAY_STATUS = [ //支付状态
self::STATUS_PAID,
self::STATUS_COLLECTION
];
const PAID_STATUS = [ //支付后的所有状态数组
self::STATUS_PAID,
self::STATUS_DELIVERY,
self::STATUS_DELIVERED,
self::STATUS_EVALUATION
]; ];
//对账状态 //对账状态
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 13:56
*/
namespace Hdll\Services\Order\Enum;
class SellerOrderEnum
{
const TYPE_VALUE_ADDED_SERVICE = 1; //增值服务
//订单状态
const STATUS_UNPAID = 10; //待支付
const STATUS_PAID = 20; //已支付
}
\ No newline at end of file
...@@ -15,57 +15,139 @@ use Swoft\Core\ResultInterface; ...@@ -15,57 +15,139 @@ use Swoft\Core\ResultInterface;
/** /**
* The interface of demo service * The interface of demo service
* *
* @method ResultInterface deferCreateOrder( string $token,int $consignee_id,int $activity_id,int $selected_num,int $order_type,float $total,float $goods_price,string $goods_name,string $goods_image,string $activity_name,string $reservation_time = '') * @method ResultInterface deferCreateOrder(int $buyerId,int $storeId,int $consigneeId,int $itemId,int $selectedNum,int $orderType,int $total,int $activityPrice,string $goodsName,string $goodsImage,string $activityName,int $goodsId,int $goodsPrice,string $reservation_time = '',string $message = '');
* @method ResultInterface deferGetOrderInfoBySn(int $storeId, string $orderSn) * @method ResultInterface deferGetOrderInfoBySn(int $storeId, string $orderSn, array $consigneeFields = [], array $itemFields = [])
* @method ResultInterface deferGetOrderInfo(int $storeId,int $orderId) * @method ResultInterface deferGetOrderInfo(int $storeId,int $orderId)
* @method ResultInterface deferUpdateInfoById(int $storeId,int $orderId, array $updateInfo)
* @method ResultInterface deferGetSimpleList($storeId, $condition, $fields = ['*'])
* @method ResultInterface deferUpdateInfoByIds(int $storeId,array $orderIds, array $updateInfo)
* @method ResultInterface deferCollectionClose(int $storeId, int $orderId)
* @method ResultInterface deferGetOtherInfo(int $storeId, string $orderSn, array $consigneeFields = [], array $itemFields = [])
*/ */
interface OrderInterface interface OrderInterface
{ {
/** /**
* 创建订单 * 创建订单
*
* @param int $buyerId * @param int $buyerId
* @param int $storeId * @param int $storeId
* @param int $consignee_id * @param int $consigneeId
* @param int $item_id * @param int $itemId
* @param int $selected_num * @param int $selectedNum
* @param int $order_type * @param int $orderType
* @param float $total * @param int $total
* @param float $goods_price * @param int $activityPrice
* @param string $goods_name * @param string $goodsName
* @param string $goods_image * @param string $goodsImage
* @param string $activity_name * @param string $activityName
* @param int $goodsId
* @param int $goodsPrice
* @param string $reservation_time * @param string $reservation_time
* @param string $message
* @return mixed * @return mixed
*/ */
public function createOrder( public function createOrder(
int $buyerId, int $buyerId,
int $storeId, int $storeId,
int $consignee_id, int $consigneeId,
int $item_id,
int $selected_num,
int $order_type,
float $total,
float $goods_price,
string $goods_name,
string $goods_image,
string $activity_name,
string $reservation_time = '');
public function sellerCreateOrder(
int $sellerId,
int $storeId,
int $itemId, int $itemId,
int $selectedNum, int $selectedNum,
int $orderType, int $orderType,
float $total, int $total,
float $goodsPrice, int $activityPrice,
string $goodsName string $goodsName,
string $goodsImage,
string $activityName,
int $goodsId,
int $goodsPrice,
string $reservation_time = '',
string $message = ''
); );
public function getOrderInfo(int $storeId,int $orderId); public function getOrderInfo(int $storeId,int $orderId);
public function getOrderInfoBySn(int $storeId, string $orderSn); public function getOrderInfoBySn(int $storeId, string $orderSn, array $consigneeFields = [], array $itemFields = []);
public function updateInfoById(int $storeId,int $orderId, array $updateInfo);
public function closeOrder(int $storeId,int $orderId);
/**
* 获取订单数据
* 字段值
* `id`,
`orderSn`,
`paySn`,
`orderType` '订单类型:0普通商品,1活动',
`storeId`, 店铺id
`buyerId` ,买家id
`itemId` '0',
`consigneeId` '付款人(收货人)ID,当线下订单时为空',
`goodsAmount` ,
`orderAmount` '订单应付款',
`actualAmount` '订单实付款',
`refundAmount` '退款金额',
`state` '订单状态:0(已取消)10(默认):未付款;20:已付款;30:已发货/已预约;40:已收货/已核销;50-申请退款;60退款成功,70 已关闭,80,退款中,90,已评价',
`refundState` '0' COMMENT '退款状态:0是无退款,1是部分退款,2是全部退款',
`refundMsg`'退款原因',
`lockState` '锁定状态:0是正常,大于0是锁定',
`lockMsg` '订单锁定原因',
`balanceState` '对账状态:0-未对账,1-已对账',
`balanceTime` '对账时间',
`message` ,
`reservationTime` ,
`createTime` 创建时间,
`updateTime` 更新时间,
`deleteTime` 删除时间,
`sellerId` '卖家id',
`deliveredTime` '核销时间',
*
*
* @param $storeId
* @param $condition
* @param array $fields
* @return mixed
*/
public function getSimpleList($storeId, $condition, $fields = ['*']);
/**
* 退款成功
*
* @param int $storeId
* @param array $orderInfo
* @return mixed
*/
public function refundSuccess(int $storeId, array $orderInfo);
/**
* 拼团关闭订单,含退款
*
* @param int $storeId
* @param int $orderId
* @return mixed
*/
public function collectionClose(int $storeId, int $orderId);
/**
* 批量更新
*
* @param int $storeId
* @param array $orderIds
* @param array $updateInfo
* @return mixed
*/
public function updateInfoByIds(int $storeId,array $orderIds, array $updateInfo);
/**
* 获取订单联系人信息,item信息用
*
* @param int $storeId
* @param string $orderSn
* @param array $consigneeFields
* @param array $itemFields
* @return mixed
*/
public function getOtherInfo(int $storeId, string $orderSn, array $consigneeFields = [], array $itemFields = []);
public function updateInfoById(int $orderId, array $updateInfo);
} }
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 13:57
*/
namespace Hdll\Services\Order\Lib;
interface SellerOrderInterface
{
public function sellerCreateOrder(
int $sellerId,
int $storeId,
int $itemId,
int $selectedNum,
int $orderType,
float $total,
float $goodsPrice,
string $goodsName
);
public function getOrderInfo(int $storeId,int $orderId);
public function getOrderInfoBySn(int $storeId, string $orderSn);
public function updateInfoById(int $storeId,int $orderId, array $updateInfo);
}
\ No newline at end of file
...@@ -11,10 +11,54 @@ use Swoft\Core\ResultInterface; ...@@ -11,10 +11,54 @@ use Swoft\Core\ResultInterface;
/** /**
* @method ResultInterface deferCreateOrder(int $storeId, int $orderId, int $openId) * @method ResultInterface deferCreateOrder(int $storeId, int $orderId, int $openId)
* @method ResultInterface deferGenerateSellerSign(int $storeId, int $orderId, string $openId)
* @method ResultInterface deferRePay(int $storeId, int $orderId, int $buyerId)
* @method ResultInterface deferSellerRePay(int $storeId, int $orderId, int $sellerId)
*
* Interface PayInterface * Interface PayInterface
* @package Hdll\Services\Pay\Lib * @package Hdll\Services\Pay\Lib
*/ */
interface PayInterface interface PayInterface
{ {
/**
* 买家生成签名
*
* @param int $storeId
* @param int $orderId
* @param string $openId
* @return mixed
*/
public function generateSign(int $storeId, int $orderId, string $openId); public function generateSign(int $storeId, int $orderId, string $openId);
/**
* 卖家生成签名
*
* @param int $storeId
* @param int $orderId
* @param string $openId
* @return mixed
*/
public function generateSellerSign(int $storeId, int $orderId, string $openId);
/**
* 卖家重新支付生成签名
*
* @param int $storeId
* @param int $orderId
* @param int $sellerId
* @return mixed
*/
public function sellerRePay(int $storeId, int $orderId, int $sellerId);
/**
* 买家重新支付,生成签名
*
* @param int $storeId
* @param int $orderId
* @param int $buyerId
* @return mixed
*/
public function rePay(int $storeId, int $orderId, int $buyerId);
} }
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 15:28
*/
namespace Hdll\Services\Reservation\Enum;
class ReservEnum
{
const TYPE_ORDER = 1; // 表示从订单创建产生的预约
const TYPE_SELLER = 2; // 表示卖家自己后台添加的预约
const TYPE_AFTER = 3; // 表示订购服务的后续服务的预约
}
\ No newline at end of file
...@@ -17,6 +17,7 @@ use Swoft\Core\ResultInterface; ...@@ -17,6 +17,7 @@ use Swoft\Core\ResultInterface;
* The interface of Reservation service * The interface of Reservation service
* *
* @method ResultInterface deferGetReservById(int $storeId, int $id) * @method ResultInterface deferGetReservById(int $storeId, int $id)
* @method ResultInterface deferIsReserved(int $storeId, int $cmanId, int $reservTime)
* @method ResultInterface deferGetReservListByOrderId(int $storeId, int $orderId, int $state = 0, int $type = 1) * @method ResultInterface deferGetReservListByOrderId(int $storeId, int $orderId, int $state = 0, int $type = 1)
* @method ResultInterface deferModifyReservById(int $storeId, int $id, array $data) * @method ResultInterface deferModifyReservById(int $storeId, int $id, array $data)
* @method ResultInterface deferAddReservation(int $storeId, int $orderId, int $buyerId, int $cmanId, int $reservTime, string $memo, int $type) * @method ResultInterface deferAddReservation(int $storeId, int $orderId, int $buyerId, int $cmanId, int $reservTime, string $memo, int $type)
...@@ -35,6 +36,18 @@ interface ReservationInterface ...@@ -35,6 +36,18 @@ interface ReservationInterface
public function getReservById(int $storeId, int $id); public function getReservById(int $storeId, int $id);
/** /**
* 检查指定的时间是否已被预约过
*
* @param integer $storeId 店铺id
* @param integer $cmanId 手艺人id,查询某个手艺人下的预约情况,$cmanId == 0表示不指定手艺人,
* @param integer $reservTime 要检查的时间点,时间戳格式
* @Number(name="cmanId")
* @Number(name="reservTime")
* @return boolen true:已预约,false:未预约
*/
public function isReserved(int $storeId, int $cmanId, int $reservTime);
/**
* 根据订单id,获取商家某个订单包含的所有预约 * 根据订单id,获取商家某个订单包含的所有预约
* *
* @param integer $storeId * @param integer $storeId
......
...@@ -12,11 +12,14 @@ use Swoft\Core\ResultInterface; ...@@ -12,11 +12,14 @@ use Swoft\Core\ResultInterface;
/** /**
* *
* @method ResultInterface deferGetFund($sellerId) * @method ResultInterface deferGetFund($seller)
* @method ResultInterface deferAddBalance($sellerId) * @method ResultInterface deferAddBalance($seller, $money)
* @method ResultInterface deferReduceBalance($sellerId) * @method ResultInterface deferReduceBalance($seller, $money)
* @method ResultInterface deferAddTotal($sellerId) * @method ResultInterface deferAddTotal($seller, $money)
* @method ResultInterface deferReduceTotal($sellerId) * @method ResultInterface deferReduceTotal($seller, $money)
* @method ResultInterface deferAddExpectFund($seller, $money)
* @method ResultInterface deferReduceExpectFund($seller, $money)
* @method ResultInterface deferAddFund($seller, $money)
* Interface SellerInterface * Interface SellerInterface
* @package App\Lib * @package App\Lib
*/ */
...@@ -73,4 +76,31 @@ interface SellerFundInterface ...@@ -73,4 +76,31 @@ interface SellerFundInterface
*/ */
public function getFund($sellerId); public function getFund($sellerId);
/**
* 增加冻结金额
* @param $sellerId
* @param $money
* @return mixed
* @author Administrator
*/
public function addExpectFund($sellerId,$money);
/**
* 减少冻结金额
* @param $sellerId
* @param $money
* @return mixed
* @author Administrator
*/
public function reduceExpectFund($sellerId, $money);
/**
* 增加金额
* @param $sellerId
* @param $balanceFund 可提现金额
* @param $commissionFund 佣金
* @return mixed
* @author Administrator
*/
public function addFund($sellerId, $balanceFund, $commissionFund);
} }
\ No newline at end of file
...@@ -15,6 +15,7 @@ use Swoft\Core\ResultInterface; ...@@ -15,6 +15,7 @@ use Swoft\Core\ResultInterface;
* method ResultInterface deferReduceBalance($sellerId, $money) * method ResultInterface deferReduceBalance($sellerId, $money)
* method ResultInterface deferAddTotal($sellerId, $money) * method ResultInterface deferAddTotal($sellerId, $money)
* method ResultInterface deferReduceTotal($sellerId, $money) * method ResultInterface deferReduceTotal($sellerId, $money)
* method ResultInterface deferListByOrderId($storeId, $orderId)
* Interface SellerDistributionInterface * Interface SellerDistributionInterface
* @package App\Lib * @package App\Lib
*/ */
...@@ -79,4 +80,13 @@ interface SellerDistributionInterface{ ...@@ -79,4 +80,13 @@ interface SellerDistributionInterface{
* @author Administrator * @author Administrator
*/ */
public function reduceTotal($sellerId, $money); public function reduceTotal($sellerId, $money);
/**
* 获取分销记录
* @param $storeId
* @param $orderId
* @return mixed
* @author Administrator
*/
public function listByOrderId($storeId, $orderId);
} }
\ No newline at end of file
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\LimitTimeBuy\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of demo service
*
* @method ResultInterface deferChecktoken(string $formtoken,int $store_id)
*/
interface StatelessInterface
{
/**
* @param $formtoken
* @param $store_id
* @return bool
*/
public function checktoken($formtoken,$store_id);
}
\ No newline at end of file
...@@ -20,6 +20,7 @@ use Swoft\Core\ResultInterface; ...@@ -20,6 +20,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGetStoreBySellerId(int $sellerId) * @method ResultInterface deferGetStoreBySellerId(int $sellerId)
* @method ResultInterface deferUpdateStore(int $storeId, array $data) * @method ResultInterface deferUpdateStore(int $storeId, array $data)
* @method ResultInterface deferDeleteStore(int $storeId) * @method ResultInterface deferDeleteStore(int $storeId)
* @method ResultInterface deferGetWxacodeUrl(int $type, string $page, string $scene)
*/ */
interface StoreInterface interface StoreInterface
{ {
...@@ -63,7 +64,7 @@ interface StoreInterface ...@@ -63,7 +64,7 @@ interface StoreInterface
* ['bannerUrl'] => 店铺banner 图片Url * ['bannerUrl'] => 店铺banner 图片Url
* ['templateId'] => 当前使用的个性模板id * ['templateId'] => 当前使用的个性模板id
* ['storeIntro'] => 店铺介绍 * ['storeIntro'] => 店铺介绍
* ['storeHours'] => 店铺营业时间,示例:"9-22" 表示从9点到22点 * ['storeHours'] => 店铺营业时间,示例:"09:00-22:00" 表示从9点到22点
* ['vipStartTime'] => VIP订购周期,开始时间,整数类型 * ['vipStartTime'] => VIP订购周期,开始时间,整数类型
* ['vipEndTime'] => VIP订购周期,结束时间,整数类型 * ['vipEndTime'] => VIP订购周期,结束时间,整数类型
* @return int 成功更新的条数 * @return int 成功更新的条数
...@@ -77,4 +78,15 @@ interface StoreInterface ...@@ -77,4 +78,15 @@ interface StoreInterface
* @return int 成功返回删除条数 * @return int 成功返回删除条数
*/ */
public function deleteStore(int $storeId); public function deleteStore(int $storeId);
/**
* 生成店铺小程序码
*
* @param integer $type 指明哪小程序,1前台小程序,2后台小程序
* @param string $page 要跳转的小程序页面,如:pages/index/index
* @param string $scene 通过小程序码传递的参数
* @return string 成功返回小程序码的图片资源名(腾讯云存储的资源名,如:store_wxacode/9a414ff3b4c478a36c2ba7df563ee88b.png)
*/
public function getWxacodeUrl(int $type, string $page, string $scene);
} }
\ No newline at end of file
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Store\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of weapp service
*
* @method ResultInterface deferGetWxAccessToken(string $appId, string $appSecret)
*/
interface WeappInterface
{
/**
* 根据appId获取对应的access_token
*
* @param string $appId
* @param string $appSecret
* @return string
*/
public function getWxAccessToken(string $appId, string $appSecret);
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/28
* Time: 10:15
*/
namespace Hdll\Services\Transfer\Lib;
use Swoft\Core\ResultInterface;
/**
* 提现服务
*
* @method ResultInterface deferWithdraw($paySn, $openId, $realName, $amount, $type, $storeId, $withdrawId)
* Interface WithdrawInterface
* @package Hdll\Services\Transfor\Lib
*/
interface WithdrawInterface
{
public function withdraw($paySn, $openId, $realName, $amount, $type, $storeId, $withdrawId);
}
\ No newline at end of file
...@@ -12,16 +12,13 @@ use Swoft\Core\ResultInterface; ...@@ -12,16 +12,13 @@ use Swoft\Core\ResultInterface;
/** /**
* @method ResultInterface deferOpenVip($storeId,$orderId,$money) * @method ResultInterface deferOpenVip($storeId,$orderId,$money)
* @method ResultInterface deferUpdate($storeId,$condition, $data)
* Interface SellerInterface * Interface SellerInterface
* @package App\Lib * @package App\Lib
*/ */
interface VipInterface interface VipInterface
{ {
public function openVip($storeId,$orderId,$money); public function openVip($storeId,$orderId);
public function update($storeId,$condition, $data);
} }
\ No newline at end of file
<?php
/**
* 买家佣金提现接口
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\WithdrawCash\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of BuyerCnDrawInterface service
*
* @method ResultInterface deferPaySuccess(int $storeId,int $id,string $wxOrderSn,int $fee)
* @method ResultInterface deferPayFailed(int $storeId,int $id,string $message)
*/
interface BuyerCnDrawInterface{
/**
* 支付成功接口
*
* @param integer $storeId 店铺ID
* @param integer $id 提现记录ID
* @param string $wxOrderSn 微信支付订单号
* @param integer $fee 手续费
* @return void
*/
public function paySuccess(int $storeId,int $id,string $wxOrderSn,int $fee);
/**
* 支付失败接口
*
* @param integer $storeId 店铺ID
* @param integer $id 提现记录ID
* @param string $message 失败信息
* @return void
*/
public function payFailed(int $storeId,int $id,string $message);
}
\ No newline at end of file
<?php
/**
* 买家营业额提现接口
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\WithdrawCash\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of SellerFundDrawInterface service
*
* @method ResultInterface deferPaySuccess(int $storeId,int $id,string $wxOrderSn,int $fee)
* @method ResultInterface deferPayFailed(int $storeId,int $id,string $message)
*/
interface SellerFundDrawInterface{
/**
* 支付成功接口
*
* @param integer $storeId 店铺ID
* @param integer $id 提现记录ID
* @param string $wxOrderSn 微信支付订单号
* @param integer $fee 手续费
* @return boolean
*/
public function paySuccess(int $storeId,int $id,string $wxOrderSn,int $fee);
/**
* 支付失败接口
*
* @param integer $storeId 店铺ID
* @param integer $id 提现记录ID
* @param string $message 失败信息
* @return boolean
*/
public function payFailed(int $storeId,int $id,string $message);
}
\ No newline at end of file
<?php <?php
/** /**
* 家佣金提现接口 * 家佣金提现接口
* *
* @link https://swoft.org * @link https://swoft.org
* @document https://doc.swoft.org * @document https://doc.swoft.org
...@@ -11,30 +11,32 @@ namespace Hdll\Services\WithdrawCash\Lib; ...@@ -11,30 +11,32 @@ namespace Hdll\Services\WithdrawCash\Lib;
use Swoft\Core\ResultInterface; use Swoft\Core\ResultInterface;
/** /**
* The interface of SellerCnDrawInterface service * The interface of WithdrawCashInterface service
* *
* @method ResultInterface deferPaySuccess(int $storeId,int $id,string $wxOrderSn,int $fee) * @method ResultInterface deferPaySuccess(int $type,int $storeId,int $id,string $wxOrderSn,int $fee)
* @method ResultInterface deferPayFailed(int $storeId,int $id,string $message) * @method ResultInterface deferPayFailed(int $type,int $storeId,int $id,string $message)
*/ */
interface SellerCnDrawInterface{ interface WithdrawCashInterface{
/** /**
* 支付成功接口 * 支付成功接口
* *
* @param integer $type 提现类型
* @param integer $storeId 店铺ID * @param integer $storeId 店铺ID
* @param integer $id 提现记录ID * @param integer $id 提现记录ID
* @param string $wxOrderSn 微信支付订单号 * @param string $wxOrderSn 微信支付订单号
* @param integer $fee 手续费 * @param integer $fee 手续费
* @return boolean * @return boolean
*/ */
public function paySuccess(int $storeId,int $id,string $wxOrderSn,int $fee); public function paySuccess(int $type,int $storeId,int $id,string $wxOrderSn,int $fee);
/** /**
* 支付失败接口 * 支付失败接口
* *
* @param integer $type 提现类型
* @param integer $storeId 店铺ID * @param integer $storeId 店铺ID
* @param integer $id 提现记录ID * @param integer $id 提现记录ID
* @param string $message 失败信息 * @param string $message 失败信息
* @return boolean * @return boolean
*/ */
public function payFailed(int $storeId,int $id,string $message); public function payFailed(int $type,int $storeId,int $id,string $message);
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment