Commit a1813c8a by liwotian name

Merge branch 'master' of http://git.2b3.cn/tencent/services

parents 1a79c2a9 99dc777d
......@@ -9,12 +9,6 @@ namespace Hdll\Services\Auth\Enum;
class AuthError
{
const PARAMETER_ERR = ["msg" => "参数错误", "code" => 500, "errorCode" => 25001];
const TOKEN_ERROR = ["msg" => "token写入失败", "code" => 500, "errorCode" => 25100];
const WX_ERROR = ["msg" => "获取信息失败", "code" => 500, "errorCode" => 25101];
const CONFIG_ERROR = ["msg" => "配置不正确", "code" => 500, "errorCode" => 25102];
const GET_TOKEN_ERROR = ["msg" => "获取token失败", "code" => 500, "errorCode" => 25103];
const NOT_FOUND_USER = ["msg" => "获取用户信息失败", "code" => 404, "errorCode" => 25104];
......
......@@ -11,4 +11,8 @@ class BuyerEnum
{
const SCORE = 0;
//state
const STATE_NORMAL = 0;
const STATE_FREEZE = 0;
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/2
* Time: 13:48
*/
namespace Hdll\Services\Buyer\Lib;
use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferSaveBill(string $token,int $order_id,int $buyer_id,int $store_id,string $order_sn,int $money)
* Interface AgencyInterface
* @package App\Lib
*/
interface BillInterface{
/**
* 保存账单数据
* @param int $orderId //订单id
* @param int $buyerId // 买家id
* @param int $storeId // 店铺id
* @param string $orderSn //订单号
* @param int $money //订单金额
* @return mixed
* @author Administrator
*/
public function saveBill(
int $orderId,
int $buyerId,
int $storeId,
string $orderSn,
int $money
);
}
\ No newline at end of file
......@@ -17,9 +17,63 @@ use Swoft\Core\ResultInterface;
*/
interface BuyerInterface
{
/**
* 获取用户信息
*
* @param int $storeId
* @param int $buyerId
* @return mixed
array(8) {
["id"]=> int(1) //买家id
["unionId"]=>string(28) "oyDnT5OYVCQUC9X9ErkDHBNrad90"
["storeId"]=>int(0)//店铺id
["referId"]=>int(0)//推荐人ID
["state"]=>int(0)//买家状态
["nickName"]=>string(0) ""买家昵称
["profile"]=>
array(4) {
["realName"]=>string(12) "真实姓名"
["gender"]=>int(1)//性别
["phoneNumber"]=>string(11) "18812345678"//手机号
["birthday"]=>int(0) //生日
}
["commission"]=>
array(3) {
["totalCommission"]=>int(10)//总共提现
["balanceCommission"]=>int(10)//可提现金额
["expectCommission"]=>int(20)//冻结提现金额
}
}
*
*/
public function getUser(int $storeId, int $buyerId);
/**
* 更新用户信息
* $updateInfo = [
"realName" => "真实姓名",
"gender" => "性别",
"phoneNumber" => "手机号",
"birthday" => "生日"
];
* @param string $token
* @param array $data
* @return mixed
*/
public function updateProfile(string $token, array $data);
/**
* 是否已经注册用户
* @param $storeId
* @param $unionid
* @return mixed
*
* 返回值:
* array(3) {
["id"]=> int(1)//买家id
["storeId"]=> int(1) //店铺id
["referId"]=> int(0) //推荐人id
}
*/
public function hasUser($storeId,$unionid);
}
\ No newline at end of file
......@@ -19,7 +19,7 @@ interface CommissionInterface
* @param $storeId
* @param $buyerId
* @param $money
* @return mixed|bool
* @return bool
*/
public function reduceBalanceCommission($storeId, $buyerId, $money);
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/17
* Time: 14:19
*/
namespace Hdll\Services\Order\Enum;
class BuyerDistributionError
{
const E101 = ['101', '金额不能小于0'];
const E102 = [102, '该数据不属于您', 403];
const E103 = [103, '请勿重复创建', 403];
const E104 = [104, '该用户不存在或属于您的团队', 403];
public function getError($code)
{
$reflect = new \ReflectionClass(self::class);
$arr = $reflect->getConstant('E' . substr($code, -3));
if (!is_array($arr)) {
return false;
}
return [
'code' => $arr[0],
'msg' => $arr[1],
'errorCode' => $arr[2],
];
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/2
* Time: 13:48
*/
namespace Hdll\Services\BuyerDistribution\Lib;
/**
* @method ResultInterface deferAddSellerFreezeMoney(int $storeId,int $money)
* @method ResultInterface deferGetBuyerCommission(int $buyerId)
* @method ResultInterface deferGetSellerFund(int $storeId)
* @method ResultInterface deferSaveBill(string $token,int $order_id,int $buyer_id,int $store_id,string $order_sn,int $money)
* Interface AgencyInterface
* @package App\Lib
*/
interface BuyerDistributionInterface{
/**
* 增加卖家冻结金额
* @param int $storeId
* @param int $money 冻结金额(千分)
* @return mixed
* @author Administrator
*/
public function addSellerFreezeMoney(int $storeId,int $money);
/**
* 获取买家佣金数据
* @param int $buyerId
* @return mixed
* @author Administrator
*/
public function getBuyerCommission(int $buyerId);
/**
* 获取卖家资金数据
* @param int $storeId
* @return mixed
* @author Administrator
*/
public function getSellerFund(int $storeId);
/**
* 保存账单数据
* @param string $token
* @param int $order_id
* @param int $buyer_id
* @param int $store_id
* @param string $order_sn
* @param int $money
* @return mixed
* @author Administrator
*/
public function saveBill(
string $token,
int $order_id,
int $buyer_id,
int $store_id,
string $order_sn,
int $money
);
}
\ No newline at end of file
......@@ -119,7 +119,7 @@ class CommonEntity extends Model
$user = App::getBean(User::class);
$store = $user->getStoreId();
if ( empty($store) ) {
if ( $store === null && $store === [] && $store === '' ) {
throw new Exception("店铺id获取失败");
}
......
......@@ -33,21 +33,25 @@ class ExceptionData
$data = [
"code" => $e->getCode(),
"msg" => $e->getMessage(),
"errCode" => is_callable([$e,'getErrCode'])?$e->getErrcode():'',
"errCode" => is_callable([$e,'getErrCode'])?$e->getErrcode():-1,
'path' =>[],
];
if ( is_callable([$e,"getPath"]) ) {//自建异常类处理path
$data['path'] = json_decode($e->getPath(), true);
//获取调用堆栈信息
$info = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,1)[0];
//将此次异常信息入站
array_unshift($data['path'],'Service:'.APP_NAME.' file:'.$info['file'].'('.$info['line'].')');
} else { //系统异常统一报500错误
$data['code'] = 500;
//将此次异常信息入站
array_unshift($data['path'],'Service:'.APP_NAME.' file:'.$e->getFile().'('.$e->getLine().')');
}
//获取调用堆栈信息
$info = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,1)[0];
//将此次异常信息入站
array_unshift($data['path'],'Service:'.APP_NAME.' file:'.$info['file'].'('.$info['line'].')');
return ['msg' => json_encode($data), 'code' => $data['code']];
......
<?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 AuthPoolConfig extends PoolProperties
{
/**
* the name of pool
*
*/
protected $name = 'auth';
/**
* 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 = 5;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
*/
protected $uri = [
"172.21.0.19:8099",
"172.16.255.39:8099"
];
/**
* 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 = '';
}
......@@ -61,7 +61,7 @@ class BuyerPoolConfig extends PoolProperties
* the time of connect timeout
*
*/
protected $timeout = 200;
protected $timeout = 5;
/**
* the addresses of connection
......@@ -75,8 +75,8 @@ class BuyerPoolConfig extends PoolProperties
*
*/
protected $uri = [
"192.168.3.100:8101"
"172.21.0.12:8099",
"172.16.255.33: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;
/**
* the config of service user
*
* @Bean()
*/
class GoodsPoolConfig extends PoolProperties
{
protected $name = 'seller';
/**
* 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 = [
'192.168.3.39:8400',
];
/**
* 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 = '';
}
......@@ -20,7 +20,7 @@ use Swoft\Pool\PoolProperties;
class OrderPoolConfig extends PoolProperties
{
protected $name = 'buyer';
protected $name = 'order';
/**
* Minimum active number of connections
......@@ -62,7 +62,7 @@ class OrderPoolConfig extends PoolProperties
*
* @var int
*/
protected $timeout = 200;
protected $timeout = 5;
/**
* the addresses of connection
......@@ -77,7 +77,7 @@ class OrderPoolConfig extends PoolProperties
* @var array
*/
protected $uri = [
'192.168.3.100:8100',
'192.168.3.100:8084',
];
/**
......
<?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 user
*
* @Bean()
*/
class ReservationPoolConfig extends PoolProperties
{
protected $name = 'reservation';
/**
* 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 = [
'192.168.3.23:8095',
'192.168.3.23:8095',
];
/**
* 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 = '';
}
<?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 user
*
* @Bean()
*/
class SchedulePoolConfig extends PoolProperties
{
protected $name = 'schedule';
/**
* 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 = [
'192.168.3.23:8096',
'192.168.3.23:8096',
];
/**
* 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 = '';
}
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/8
* Time: 10:43
*/
namespace Hdll\Services\Goods\Lib;
use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferGet($storeId, $id)
* Interface GoodsInterface
* @package Hdll\Services\Goods\Lib
*/
interface GoodsInterface
{
/**
* 获取商品
* @param $storeId
* @return [
* 'gcId' 商品类ID
* 'asId' 服务ID
* 'stock' 库存
* 'name' 名称
* 'image' 图片
* 'price' 价格
* 'state' 状态
* 'body' 描述
* 'originalPrice' 原价
* 'sales' 销量
* ]
* @param $id
* @return mixed
* @author Administrator
*/
public function get($storeId, $id);
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/8
* Time: 10:43
*/
namespace Hdll\Services\GroupBooking\Lib;
use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferPaySuccess($orderId)
* Interface GoodsInterface
* @package Hdll\Services\Goods\Lib
*/
interface GroupBookingInterface{
public function paySuccess($orderId);
}
\ No newline at end of file
......@@ -24,8 +24,9 @@ class OrderEnum
//订单类型
const TYPE_GOODS = 0; //商品订单
const TYPE_KANJIA = 1; //砍价订单
const TYPE_CUT_PRICE = 1; //砍价订单
const TYPE_LIMIT = 2; //限时购订单
const TYPE_COLLECTION = 3; //限时购订单
//对账状态
const BALANCE_STATE_FALSE = 0; //未对账
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/20
* Time: 11:13
*/
namespace Hdll\Services\Order\Enum;
class OrderError
{
//common
const PARAMETER_ERR = ["msg" => "参数错误", "code" => 400, "errorCode" => 22001];
const PERMISSION_DENIED = ["msg" => "没有权限,%s", "code" => 401, "errorCode" => 22104];
//validator
const UNDEFINED_VALIDATOR = ["msg" => "未定义验证其验证器%s","code" => 500, "errorCode" => 22100];
const EMPTY_COMPARE_VALUE = ["msg" => "对比数值不能为空", "code" => 500, "errorCode" => 22101];
const UNKONW_OPERATION = ["msg" => "未知操作符%s", "code" => 500, "errorCode" => 22102];
//联系人
const NO_FOUND_CONSIGNEE = ["msg" => "未找到联系人信息", "code" => 404, "errorCode" => 22103];
//预约
const RESERVATION_OVERRUN = ["msg" => "预约时间不能早于当前时间", "code" => 400, "errorCode" => 22105];
const RES_IS_REST = ["msg" => "休息日不能添加预约", "code" => 400, "errorCode" => 22106];
//买家
const FREEZE = ["msg" => "休息日不能添加预约", "code" => 400, "errorCode" => 22107];
//order
const O_PRICE_ABNORMAL = ["msg" => "价格异常,请重新购买", "code" => 400, "errorCode" => 22108];
const O_TYPE_ERR = ["msg" => "订单类型不正确", "code" => 400, "errorCode" => 22109];
const O_CREATE_ERR = ["msg" => "创建订单失败", "code" => 500, "errorCode" => 22110];
const O_GOODS_SAVE_ERR = ["msg" => "商品订单存入失败", "code" => 500, "errorCode" => 22111];
const O_CUT_PRICE_SAVE_ERR = ["msg" => "砍价订单存入失败", "code" => 500, "errorCode" => 22115];
const O_NOT_FOUND = ["msg" => "订单不存在", "code" => 404, "errorCode" => 22116];
const O_STATUS_ERR = ["msg" => "订单状态错误,无法操作", "code" => 400, "errorCode" => 22117];
const DB_ERROR = ["msg" => "数据库操作错误", "code" => 500, "errorCode" => 22118];
public static function atranslate($message,$param)
{
if ( empty($param) ) {
return $message;
}
array_unshift($param,$message);
return sprintf(...$param);
}
}
\ No newline at end of file
......@@ -16,12 +16,15 @@ use Swoft\Core\ResultInterface;
* 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 deferGetOrderInfoBySn(int $storeId, string $orderSn)
* @method ResultInterface deferGetOrderInfo(int $storeId,int $orderId)
*/
interface OrderInterface
{
/**
* 创建订单
* @param string $token
* @param int $buyerId
* @param int $storeId
* @param int $consignee_id
* @param int $item_id
* @param int $selected_num
......@@ -35,7 +38,8 @@ interface OrderInterface
* @return mixed
*/
public function createOrder(
string $token,
int $buyerId,
int $storeId,
int $consignee_id,
int $item_id,
int $selected_num,
......@@ -46,4 +50,8 @@ interface OrderInterface
string $goods_image,
string $activity_name,
string $reservation_time = '');
public function getOrderInfo(int $storeId,int $orderId);
public function getOrderInfoBySn(int $storeId, string $orderSn);
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/9
* Time: 13:44
*/
namespace Hdll\Services\Pay\Lib;
use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferCreateOrder(int $storeId, int $orderId, int $openId)
* Interface PayInterface
* @package Hdll\Services\Pay\Lib
*/
interface PayInterface
{
public function generateSign(int $storeId, int $orderId, int $openId);
}
......@@ -16,60 +16,80 @@ use Swoft\Core\ResultInterface;
/**
* The interface of Reservation service
*
* @method ResultInterface deferGetReservById(int $id)
* @method ResultInterface deferGetReservByDateId(int $storeId, int $dateId)
* @method ResultInterface deferGetReservListByOrderId(int $storeId, $orderId)
* @method ResultInterface deferModifyReservById(int $id)
* @method ResultInterface deferCancelReservById(int $id)
* @method ResultInterface deferGetReservById(int $storeId, int $id)
* @method ResultInterface deferGetReservListByOrderId(int $storeId, int $orderId, int $state = 0, int $type = 1)
* @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 deferCancelReservById(int $storeId, int $id)
* @method ResultInterface deferCancelReservByOrderId(int $storeId, int $orderId)
*/
interface ReservationInterface
{
/**
* 获取某个预约的信息
*
* @param integer $storeId,
* @param integer $id
* @return array
*/
public function getReservById(int $id);
/**
* 根据日期id,获取商家某一天的所有预约
*
* @param integer $storeId
* @param integer $dateId
* @return array
*/
public function getReservByDateId(int $storeId, int $dateId);
public function getReservById(int $storeId, int $id);
/**
* 根据订单id,获取商家某个订单包含的所有预约
*
* @param integer $storeId
* @param integer $orderId
* @return void
* @param integer $state
* @param integer $type
* @return array
*/
public function getReservListByOrderId(int $storeId, int $orderId);
public function getReservListByOrderId(int $storeId, int $orderId, int $state = 0, int $type = 1);
/**
* 修改某个预约信息
*
* @param integer $storeId,
* @param integer $id
* @param array $data
* $data 字段说明:
* ['state'] => 预约状态,默认0,如果正常结束则为1
* ['type'] => 预约类型,备用
* ['reservTime'] => 预约时间,时间戳格式
* ['isConfirm'] => 1表示商家确认预约
* ['reservTime'] => 预约时间,整形,时间戳格式
* ['memo'] => 预约备注
* @return int 返回成功修改的条数
*/
public function modifyReservById(int $id, array $data);
public function modifyReservById(int $storeId, int $id, array $data);
/**
* 添加预约
*
* @param integer $storeId
* @param integer $orderId
* @param integer $buyerId
* @param integer $cmanId 手艺人id
* @param integer $reservTime 预约的时间
* @param string $memo 预约备注
* @param integer $type 预约类型,备用
* @return integer 添加成功则返回记录id
*/
public function addReservation(int $storeId, int $orderId, int $buyerId, int $cmanId, int $reservTime, string $memo, int $type = 1);
/**
* 取消某个预约
*
* @param integer $storeId
* @param integer $id
* @return boolean 返回取消结果
*/
public function cancelReservById(int $id);
public function cancelReservById(int $storeId, int $id);
/**
* 根据订单id取消该订单下的所有预约
*
* @param integer $storeId
* @param integer $orderId
* @return boolean 返回取消结果
*/
public function cancelReservByOrderId(int $storeId, int $orderId);
}
\ No newline at end of file
......@@ -16,10 +16,10 @@ use Swoft\Core\ResultInterface;
/**
* The interface of Schedule service
*
* @method ResultInterface deferGetScheduleList(int $storeId, int $month=null)
* @method ResultInterface deferGetScheduleByDateId(int $storeId, int $dateId)
* @method ResultInterface deferUpdateSchedule(int $storeId, int $dateId, array $data)
* @method ResultInterface deferAddSchedule(int $storeId, int $dateId, array $data)
* @method ResultInterface deferGetScheduleList(int $storeId, int $month, int $cmanId = 0)
* @method ResultInterface deferGetScheduleByDateId(int $storeId, int $dateId, int $cmanId = 0)
* @method ResultInterface deferUpdateSchedule(int $storeId, int $cmanId, int $dateId, array $data)
* @method ResultInterface deferAddSchedule(int $storeId, int $cmanId, int $dateId, array $data)
*/
interface ScheduleInterface
{
......@@ -27,24 +27,26 @@ interface ScheduleInterface
* 获取店铺所有日程列表
*
* @param integer $storeId
* @param integer $month 可选参数 指定要查哪个月份的日程列表,格式如:201810
* @param integer $month 指定要查哪个月份的日程列表,格式如:201810
* @return array 空数组表示没有查询到记录
*/
public function getScheduleList(int $storeId, int $month = null);
public function getScheduleList(int $storeId, int $month, int $cmanId = 0);
/**
* 获取某天的日程信息
*
* @param integer $storeId
* @param integer $dateId 要查询的日期id,格式要求如:20180803
* @param integer $cmanId 手艺人ID,可查询指定手艺人的日程安排,为0时表示店铺级别的日程
* @return array 空数组表示没有查询到记录
*/
public function getScheduleByDateId(int $storeId, int $dateId);
public function getScheduleByDateId(int $storeId, int $dateId, int $cmanId = 0);
/**
* 根据dateId修改某个日程的信息
*
* @param integer $storeId
* @param integer $cmanId 手艺人ID,可修改指定手艺人的日程安排,$cmanId==0 时表示修改店铺级别的日程
* @param integer $dateId 要修改的日期id,格式要求如:20180803
* @param array $data
* 参数 $data 字段说明:
......@@ -52,12 +54,13 @@ interface ScheduleInterface
*
* @return int 成功更新的条数
*/
public function updateSchedule(int $storeId, int $dateId, array $data);
public function updateSchedule(int $storeId, int $cmanId, int $dateId, array $data);
/**
* 添加一个日程安排
*
* @param integer $storeId
* @param integer $cmanId 手艺人ID,给指定的手艺人添加日程安排,$cmanId==0 时表示添加店铺级别的日程
* @param integer $dateId 要添加的日期id,格式要求如:20180803
* @param array $data
* 参数 $data 字段说明:
......@@ -65,5 +68,6 @@ interface ScheduleInterface
*
* @return int
*/
public function addSchedule(int $storeId, int $dateId, array $data);
public function addSchedule(int $storeId, int $cmanId, int $dateId, array $data);
}
\ No newline at end of file
......@@ -12,8 +12,11 @@ use Swoft\Core\ResultInterface;
/**
*
* @method ResultInterface deferWithdraw($sellerId, $money)
* @method ResultInterface deferWithdrawFail($sellerId, $money)
* @method ResultInterface deferGetFund($sellerId)
* @method ResultInterface deferAddBalance($sellerId)
* @method ResultInterface deferReduceBalance($sellerId)
* @method ResultInterface deferAddTotal($sellerId)
* @method ResultInterface deferReduceTotal($sellerId)
* Interface SellerInterface
* @package App\Lib
*/
......@@ -22,21 +25,52 @@ interface SellerFundInterface
/**
* 提现
* @param $sellerId
* @param $money (分)
* 增加提现金额
* @param $seller
* @param $money
* @return mixed
* @author Administrator
*/
public function addBalance($seller, $money);
/**
* 减少提现金额
* @param $seller
* @param $money
* @return mixed
* @author Administrator
*/
public function reduceBalance($seller, $money);
/**
* 增加总提现金额
* @param $seller
* @param $money
* @return mixed
* @author Administrator
*/
public function addTotal($seller, $money);
/**
* 减少总提现金额
* @param $seller
* @param $money
* @return mixed
* @author Administrator
*/
public function withdraw($sellerId, $money);
public function reduceTotal($seller, $money);
/**
* 提现失败
*
* @param $sellerId
* @param $money (分)
* @return mixed
* totalFund 累计资金
* balanceFund 可提现金额
* commissionFund 需要支付的佣金
* expectFund 冻结金额
* totalWithdraw 累计提现
* @author Administrator
*/
public function withdrawFail($sellerId, $money);
public function getFund($sellerId);
}
\ No newline at end of file
......@@ -13,7 +13,8 @@ use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferSave($referId, $unionId, $openId, $nickName, $headImgUrl, $realName, $phoneNumber)
* @method ResultInterface deferGet($id,$fields=['*'])
* @method ResultInterface deferUpdate($id)
* @method ResultInterface deferGetByUnionId($unionId,$fields=['*'])
* @method ResultInterface deferUpdate($id,$data)
* Interface SellerInterface
* @package App\Lib
*/
......@@ -42,6 +43,14 @@ interface SellerInterface
public function get($id,$fields=['*']);
/**
* @param $unionId
* @param array $fields
* @return mixed
* @author Administrator
*/
public function getByUnionId($unionId,$fields=['*']);
/**
* @param $condition
* @param $data
* $data['referId']=>'来源ID'
......
......@@ -10,6 +10,11 @@ use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferSaveBill($orderId, $sellerId, $money)
* @method ResultInterface deferGetCommission($sellerId)
* method ResultInterface deferAddBalance($sellerId, $money)
* method ResultInterface deferReduceBalance($sellerId, $money)
* method ResultInterface deferAddTotal($sellerId, $money)
* method ResultInterface deferReduceTotal($sellerId, $money)
* Interface SellerDistributionInterface
* @package App\Lib
*/
......@@ -28,4 +33,50 @@ interface SellerDistributionInterface{
*/
public function saveBill($orderId, $sellerId, $money);
/**
* 获取佣金信息
* @param $sellerId
* @return mixed
* totalCommission 累计佣金
* balanceCommission 可提现佣金
* @author Administrator
*/
public function getCommission($sellerId);
/**
* 增加佣金
* @param $sellerId
* @param $money
* @return mixed
* @author Administrator
*/
public function addBalance($sellerId, $money);
/**
* 减少佣金
* @param $sellerId
* @param $money
* @return mixed
* @author Administrator
*/
public function reduceBalance($sellerId, $money);
/**
* 增加累计佣金
* @param $sellerId
* @param $money
* @return mixed
* @author Administrator
*/
public function addTotal($sellerId, $money);
/**
* 减少累计佣金
* @param $sellerId
* @param $money
* @return mixed
* @author Administrator
*/
public function reduceTotal($sellerId, $money);
}
\ 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 store-commission service
*
* @method ResultInterface deferGetCommSetting(int $storeId)
* @method ResultInterface deferUpdateByStoreId(int $storeId)
*/
interface CommsettingInterface
{
/**
* 获取买家分销佣金规则
*
* @Number(name="storeId")
* @param int $storeId
* @return array
* 返回内容说明:
* ['state'] => 分销佣金规则是否启用,0不启用,1启用
* ['rule'] => 分销佣金规则具体设置内容,json格式: {"1":35,"2":14.5}
* ['minWithdraw'] => 最小提现金额,单位分
* ['memo'] => 规则备注说明
*/
public function getCommSetting(int $storeId);
/**
* 根据店铺ID修改买家分销的佣金规则
*
* @Number(name="storeId")
* @param integer $storeId
* @param array $data
* 参数$data 字段说明:
* ['state'] => 分销佣金规则是否启用,0不启用,1启用
* ['rule'] => 分销佣金规则具体设置内容,json格式: {"1":35,"2":14.5}
* ['minWithdraw'] => 最小提现金额,单位分
* ['memo'] => 规则备注说明
* @return array
*/
public function updateByStoreId(int $storeId, array $data);
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/10
* Time: 14:14
*/
namespace Hdll\Services\Transfer\Enum;
class TransferEnum
{
const SUCCESS = 0;
const FAIL = 1;
const RETRY = 2;
}
\ 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