From 58e7532bebd71c1542262ad4341bbecbe7c05e0b Mon Sep 17 00:00:00 2001 From: twb_eelly_mac <1174865138@qq.com> Date: Tue, 15 Jun 2021 11:22:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=9B=B4=E6=92=AD=E9=A2=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EellyOldCode/Api/GoodsTiktokUpload.php | 2 +- src/SDK/Live/Api/LiveBook.php | 96 +++++++++++++++++++ src/SDK/Live/Exception/LiveException.php | 6 ++ 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 src/SDK/Live/Api/LiveBook.php diff --git a/src/SDK/EellyOldCode/Api/GoodsTiktokUpload.php b/src/SDK/EellyOldCode/Api/GoodsTiktokUpload.php index 49549937..63c8750f 100644 --- a/src/SDK/EellyOldCode/Api/GoodsTiktokUpload.php +++ b/src/SDK/EellyOldCode/Api/GoodsTiktokUpload.php @@ -57,7 +57,7 @@ class GoodsTiktokUpload * @param string $params.storeName 商品ID * @param string $params.goodsNumber 商品编码 * @param string $params.cateId 商品分类ID - * @param int $params.ifShow 上架状态 0 全部 1 上架中 2 已下架 + * @param int $params.ifShow 上架状态 -1 全部 0 已下架 1 上架中 * @param string $params.sortKey 排序字段,不排序此字段值传空字符串 price 销售价格 stock 库存 expireTime 创建时间 * @param int $params.asc 0 降序 1 升序 * @param int $page 页数 diff --git a/src/SDK/Live/Api/LiveBook.php b/src/SDK/Live/Api/LiveBook.php new file mode 100644 index 00000000..1fcd0604 --- /dev/null +++ b/src/SDK/Live/Api/LiveBook.php @@ -0,0 +1,96 @@ + + */ + public static function getShopSubscribeAmount(array $condition = []): array + { + return EellyClient::requestJson('live/liveBook', __FUNCTION__, ['condition' => $condition], true); + } + + /** + * 后台 厂+直播预约管理 + * + * @param array $condition 搜索条件 + * @param int $currentPage 页数 + * @param int $limit 单页限制 + * + * @since 2021-06-09T09:33:37+0800 + * @author twb<1174865138@qq.com> + */ + public static function getAdminLiveBookList(array $condition = [], int $currentPage = 1, int $limit = 100): array + { + return EellyClient::requestJson('live/liveBook', __FUNCTION__, ['condition' => $condition, 'currentPage' => $currentPage, 'limit' => $limit], true); + } + + /** + * 店铺预约历史 + * + * @param array $condition 搜索条件 + * @param int $currentPage 页数 + * @param int $limit 单页限制 + * + * @since 2021-06-09T09:33:37+0800 + * @author twb<1174865138@qq.com> + */ + public static function getAdminliveBookDetail(array $condition = [], int $currentPage = 1, int $limit = 100): array + { + return EellyClient::requestJson('live/liveBook', __FUNCTION__, ['condition' => $condition, 'currentPage' => $currentPage, 'limit' => $limit], true); + } + + /** + * 查看店铺的可预约数据 + * + * @param int $storeId 店铺id + * + * @since 2021-06-09T09:33:37+0800 + * @author twb<1174865138@qq.com> + */ + public static function checkAdminliveBook(int $storeId = 100): array + { + return EellyClient::requestJson('live/liveBook', __FUNCTION__, ['storeId' => $storeId], true); + } + + /** + * 手动直播预约 + * + * @param array $params 预约数据 + * + * @since 2021-06-09T09:33:37+0800 + * @author twb<1174865138@qq.com> + */ + public static function adminliveBook(array $params = []): array + { + return EellyClient::requestJson('live/liveBook', __FUNCTION__, ['params' => $params], true); + } + + public static function getInstance(): self + { + static $instance; + if (null === $instance) { + $instance = new self(); + } + + return $instance; + } +} diff --git a/src/SDK/Live/Exception/LiveException.php b/src/SDK/Live/Exception/LiveException.php index 45fe0260..21090b85 100644 --- a/src/SDK/Live/Exception/LiveException.php +++ b/src/SDK/Live/Exception/LiveException.php @@ -24,4 +24,10 @@ use Eelly\Exception\LogicException; class LiveException extends LogicException { + public const CHANNEL_FULL = '预约名额已满,请重选日期,或更换时段试试'; + + public const ALREADY_BOOKED = '存在相同预约, 请免重复'; + + public const NO_USE_IMAGES = '没有使用中的店家直播图片'; + } -- Gitee