Commit e43e836a by xmy

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	UPGRADE_2.x.md
parents 6f8ee410 baedffcb
# 2.0.15
- 分成比例修改
# 2.0.14
- Cls记日志忽略‘验证器不存在’的日志
# 2.0.13
- ClsLog延迟时判断协程模式
# 2.0.12
- 配合前端改版后端大调整
# 2.0.11
- 关闭拼团活动状态
砍价订单枚举状态加订单删除
# 2.0.10
- 根据商户平台id获取对应的小程序托管配置
......
......@@ -21,6 +21,6 @@ class BargainEnum
const PAY_EXCEPTION = 3;
const PAY_REFUND = 4; // 退款
const PAY_CLOSE = 5; // 订单关闭
const ORDER_DELELTED = 6; //订单删除
const ORDER_DELETED = 6; //订单删除
}
\ No newline at end of file
......@@ -16,9 +16,11 @@ use Swoft\Core\ResultInterface;
/**
* The interface of demo service
*
* @method ResultInterface deferGetgoodsinfo(int $limit_id)
* @method ResultInterface deferGetBargainInfo(int $limit_id)
* @method ResultInterface deferGetgoodsInfo(int $storeId, int $bargain_id)
* @method ResultInterface deferGetBargainInfo(int $storeId, int $goodsId)
* @method ResultInterface deferPayStatus(string $storeId,int $bargainbranchId,int $status, int $orderId)
* @method ResultInterface deferGetBargainCounts(int $storeId)
* @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime)
*/
interface BargainInterface
{
......@@ -33,9 +35,7 @@ interface BargainInterface
* "activityName" 活动名称
* }
*/
public function getGoodsInfo(
int $stordId, int $bargain_id
);
public function getGoodsInfo(int $storeId, int $bargain_id);
/**
......@@ -45,9 +45,7 @@ interface BargainInterface
* @return bool
*
*/
public function getBargainInfo(
int $storeId, int $goodsId
);
public function getBargainInfo(int $storeId, int $goodsId);
/**
......@@ -57,18 +55,23 @@ interface BargainInterface
* @param int $status // BargainEnum::HAVE_PAY 成功支付 BargainEnum::PAY_EXCEPTION:未支付 (已经过期或者支付异常)
* @return mixed
*/
public function payStatus(
string $storeId,
int $bargainbranchId,
int $status , //
int $orderId);
public function payStatus(string $storeId,int $bargainbranchId,int $status, int $orderId);
/**
/**
* 获取砍价活动总个数 和正在进行的个数
*
* @return mixed
*/
public function getBargainCounts(int $storeId);
/**
*获取自上次时间以来产生的新订单数
*
* @param [int] $storeId
* @param [int] $lastTime
* @return int
*/
public function getNewOrderNum(int $storeId,int $lastTime);
}
......
......@@ -63,7 +63,11 @@ class ClsLog
if($res->getResponse()->getStatusCode() == 200) {
return true;
}
Coroutine::sleep(1);
if (App::isCoContext()) {
Coroutine::sleep(2);
} else {
sleep(2);
}
}
$msg = '上传腾讯云日志服务失败:'.$res->getResult();
self::writeClsErrors($msg);
......
......@@ -38,7 +38,14 @@ class LogHandler extends AbstractProcessingHandler
}
$lines = array_column($records, 'formatted');
$this->write($lines);
foreach($lines as $k => $v) {
if(strpos($v, '验证器不存在') !== false) {
unset($lines[$k]);
}
}
if($lines) {
$this->write($lines);
}
}
/**
......
......@@ -7,7 +7,7 @@ class CfgCenter
{
/**
* 读取指定的配置项
* 读取指定的配置项 - 返回对象格式
* (所有配置项,需预先添加到数据库中)
* 方法一:
* $value = CfgCenter::get('qCloud>Weapp>Region');
......@@ -17,9 +17,45 @@ class CfgCenter
* var_dump($cfgdata->Weapp->Region); // 输出:ap-shanghai
*
* @param string $keyStr
* @param string $default 默认返回值
* @return mixed
*/
public static function get($keyStr)
public static function get($keyStr, $default='')
{
$data = self::_get($keyStr);
if($data == '') {
return $default;
}
return $data;
}
/**
* 读取指定的配置项 - 返回数组格式
* (所有配置项,需预先添加到数据库中)
* 方法一:
* $value = CfgCenter::get('qCloud>Weapp>Region');
* var_dump($value); // 输出:ap-shanghai
* 方法二:
* $cfgdata = CfgCenter::get('qCloud');
* var_dump($cfgdata['Weapp']['Region']); // 输出:ap-shanghai
*
* @param string $keyStr
* @param string $default 默认返回值
* @return mixed
*/
public static function getArray($keyStr, $default='')
{
$data = self::_get($keyStr);
if($data == '') {
return $default;
}
if(is_object($data)) {
return json_decode(json_encode($data), true);
}
return $data;
}
private static function _get($keyStr)
{
$keyArr = self::parseKeyStr($keyStr);
$rkey = implode(":", $keyArr);
......@@ -48,7 +84,8 @@ class CfgCenter
{
$keyArr = self::parseKeyStr($keyStr);
$name = array_shift($keyArr);
$result = self::dbConnect()->select("config", ['name','value'], ['name'=>$name]);
$dbConn = self::dbConnect();
$result = $dbConn->select("config", ['name','value'], ['name'=>$name]);
if(!isset($result[0]['value'])) {
return;
}
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/26
* Time: 16:00
*/
namespace Hdll\Services\FlowCount\Enum;
class FlowCategory
{
const BARGAIN = 1; // 砍价
const LIMIT = 2; // 限时购
const GROUP = 3; // 团购
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferAdd(int $storeId, array $data)
* @method ResultInterface deferBrowseAndShare(int $storeId, int $type, array $itemIds)
* @method ResultInterface deferNewVisitor(int $storeId, int $type, array $itemIds = null)
* Interface VisitorInterface
* @package App\Lib
*/
......@@ -55,4 +56,22 @@ interface VisitorInterface
*/
public function browseAndShare(int $storeId, int $type, array $itemIds);
/**
* 统计是否有新访客
* @param int $storeId 店铺id
* @param int $type 类型:FlowCategory::BARGAIN 砍价 FlowCategory::LIMIT 限时购 FlowCategory::GROUP 拼团
* @param array $itemIds 活动ids列表,格式:[1,2,3],默认:null
* @return mixed
* 响应参数:
* [
* 'time' => 上次统计时间戳,
* 'list' => [ // 参数$itemIds为空时list为空
* ['活动id' => 活动新访客数],
* ['活动id' => 活动新访客数],
* ... ...
* ]
* ]
*/
public function newVisitor(int $storeId, int $type, array $itemIds = null);
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ class LimitTimeOrderEnum
const STATUS_HAVE_PAY =2; // 已经支付 //=已下单
const STATUS_PAY_EXCEPTION =3; // 支付异常或过期未付 //=关闭订单
const STATUS_PAY_REFUND =4 ; // 退款 //=已过期
const ORDER_DELETED = 5; //订单删除
//------------状态转换-----------------------
......
......@@ -17,7 +17,11 @@ use Swoft\Core\ResultInterface;
* The interface of demo service
*
* @method ResultInterface deferBackNum(string $token, int $consignee_id, int $limit_id, int $selected_num, int $order_type, int $goods_id, string $reservation_time = '')
* @method ResultInterface deferGetLimitCounts(int $storeId)
* @method ResultInterface deferGetLimitGoods(int $storeId, int $limitId)
* @method ResultInterface deferGetLimitInfo(int $storeId, int $goodsId)
* @method ResultInterface deferPayStatus(string $store_id,int $limit_id, int $status, int $orderId)
* @method ResultInterface deferGetLimitCounts(int $storeId)
* @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime)
*/
interface LimitTimeBuyInterface
{
......@@ -52,9 +56,7 @@ interface LimitTimeBuyInterface
* "activityName" 活动名称
* }
*/
public function getLimitGoods(
int $storeId, int $limitId
);
public function getLimitGoods(int $storeId, int $limitId);
/**
* 通过商品id 获取是否 有限时购活动
......@@ -63,9 +65,7 @@ interface LimitTimeBuyInterface
* @return bool
*
*/
public function getLimitInfo(
int $storeId, int $goodsId
);
public function getLimitInfo(int $storeId, int $goodsId);
/**
......@@ -77,11 +77,7 @@ interface LimitTimeBuyInterface
* @return bool|mixed
* @throws ConException
*/
public function payStatus(
string $store_id,
int $limit_id,
int $status,
int $orderId);
public function payStatus(string $store_id,int $limit_id,int $status, int $orderId);
/**
* 获取限时购活动总个数 和正在进行的个数
......@@ -89,4 +85,14 @@ interface LimitTimeBuyInterface
* @return mixed
*/
public function getLimitCounts(int $storeId);
}
\ No newline at end of file
/**
*获取自上次时间以来产生的新订单数
*
* @param [int] $storeId
* @param [int] $lastTime
* @return int
*/
public function getNewOrderNum(int $storeId,int $lastTime);
}
......@@ -29,6 +29,8 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferAddShopsDailyStatistic(int $storeId,int $pId)
* @method ResultInterface deferGetShopStatistic(int $storeId)
* @method ResultInterface deferGetShopDailyStatistic(int $storeId,int $startDate,int $endDate)
* @method ResultInterface deferGetShopNewOrderNum(int $storeId)
* @method ResultInterface deferOrderCountByCondition(int $storeId,array $condition)
*/
interface OrderInterface
{
......@@ -190,11 +192,27 @@ interface OrderInterface
/**
* 指定时间(段)查询店铺交易统计
*
*
* @param integer $storeId
* @param integer $startDate
* @param integer $endDate
* @return array
*/
public function getShopDailyStatistic(int $storeId,int $startDate,int $endDate);
/**
* 查询店铺新订单数
*
* @param integer $storeId
* @return int
*/
public function getShopNewOrderNum(int $storeId);
/**
* 根据条件查询店铺订单数量(子订单数量)
*
* @param integer $storeId
* @param array $condition
* @return int
*/
public function orderCountByCondition(int $storeId,array $condition);
}
\ No newline at end of file
......@@ -10,33 +10,28 @@
namespace Hdll\Services\Recharge\Lib;
use Hdll\Services\Recharge\Enum\BuyCardPayStatus;
use Swoft\Core\ResultInterface;
/**
* The interface of demo service
*
* @method ResultInterface deferPayStatus(int $storeId,int $bargainbranchId,int $status,int $orderId)
* @method ResultInterface deferSpendCardMoney(int $storeId, int $buyerId, array $subOrders)
* @method ResultInterface deferReturnCardMoney(int $storeId,int $buyerId,int $itemOrderId,string $itemTitle,int $payMoney)
* @method ResultInterface deferPayStatus(int $storeId, int $itemId, int $status, int $orderId)
* @method ResultInterface deferSpendCardMoney(int $storeId, int $buyerId, array $subOrders, int $parentOrderId)
* @method ResultInterface deferReturnCardMoney(int $storeId,int $buyerId,int $itemOrderId,string $itemTitle,int $payMoney, int $parentOrderId)
* @method ResultInterface deferStatisNum(int $storeId)
*/
interface RechargeInterface
{
/**
* 微信支付 状态 回馈接口
* @param string $storeId //
* @param int $itemId // 项目ID $localorderId
* @param int $status // BuyCardPayStatus::HAVE_PAY 成功支付 BuyCardPayStatus::PAY_EXCEPTION:未支付 (已经过期或者支付异常)
* @param int $storeId
* @param int $itemId // 项目ID $localorderId
* @param int $status // BuyCardPayStatus::HAVE_PAY 成功支付 BuyCardPayStatus::PAY_EXCEPTION:未支付 (已经过期或者支付异常)
* @param int $orderId // 主订单id
* @return mixed
*/
public function payStatus(
int $storeId,
int $itemId,
int $status , //
int $orderId);
public function payStatus(int $storeId, int $itemId, int $status, int $orderId);
/**
* 花费卡金额
......@@ -46,9 +41,9 @@ interface RechargeInterface
* $subOrders 示例:
* [
* [
* 'id' => 333,
* 'itemName' => 'namenamename',
* 'actualAmount' => 444,
* 'id' => 333, // 子订单id
* 'itemName' => 'namenamename', // 项目名
* 'actualAmount' => 444, // 项目价格
* ],
* [
* 'id' => 555,
......@@ -56,26 +51,22 @@ interface RechargeInterface
* 'actualAmount' => 666,
* ],
* ]
* @param int $parentOrderId // 主订单id
* @return mixed
*/
public function spendCardMoney(int $storeId, int $buyerId, array $subOrders);
public function spendCardMoney(int $storeId, int $buyerId, array $subOrders, int $parentOrderId);
/**
* 退回储值卡金额
* @param int $storeId
* @param int $buyerId
* @param int $itemOrderId
* @param string $itemTitle
* @param int $payMoney
* @param int $itemOrderId // 子订单
* @param string $itemTitle // 项目名
* @param int $payMoney // 项目价格
* @param int $parentOrderId // 主订单id
* @return mixed
*/
public function ReturnCardMoney(
int $storeId,
int $buyerId,
int $itemOrderId,
string $itemTitle,
int $payMoney
);
public function ReturnCardMoney(int $storeId, int $buyerId, int $itemOrderId, string $itemTitle, int $payMoney, int $parentOrderId);
/**
* 统计储值卡上架数/总数
......
......@@ -19,6 +19,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGetReservById(int $storeId, int $id)
* @method ResultInterface deferIsReserved(int $storeId, int $cmanId, int $reservTime)
* @method ResultInterface deferGetReservListByOrderId(int $storeId, int $orderId, $state = null)
* @method ResultInterface deferGetReservListByOrderIds(int $storeId, array $orderIds, $state = null)
* @method ResultInterface deferModifyReservById(int $storeId, int $id, array $data)
* @method ResultInterface defermarkReservFinished(int $storeId, int $orderId)
* @method ResultInterface deferAddReservation(int $storeId, int $orderId, int $buyerId, int $cmanId, int $reservTime, string $memo, int $type)
......@@ -58,6 +59,17 @@ interface ReservationInterface
public function getReservListByOrderId(int $storeId, int $orderId, $state = null);
/**
* 根据订单id列表,获取对应的预约列表
*
* @param integer $storeId
* @param integer $orderIds
* @param integer $state
* @Number(name="state")
* @return array
*/
public function getReservListByOrderIds(int $storeId, array $orderIds, $state = null);
/**
* 修改某个预约信息
*
* @param integer $storeId,
......
<?php
/**
* Created by PhpStorm.
* User: mac
* Date: 2019-01-10
* Time: 09:58
*/
namespace Hdll\Services\TimesCard\Enum;
class Status{
const OK = 1; // 可删除
const EXIST = 2; // 次卡存在
const BUY = 3; // 次卡存在购买用户
}
\ No newline at end of file
......@@ -73,12 +73,10 @@ interface TimesCardInterface
* 通过商品id 获取是否 有正在服务的次卡用户
* @param int $storeId
* @param int $goodsId
* @return bool
* @return int 返回状态:Status::OK 可删除 Status::EXIST 次卡存在 Status::BUY次卡存在购买用户
*
*/
public function getTimesCardUserCardInfo(
int $storeId, int $goodsId
);
public function getTimesCardUserCardInfo(int $storeId, int $goodsId);
/**
* 统计次卡上架数/总数
......
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