初始化项目:添加后端代码、ThinkPHP框架、前端资源

This commit is contained in:
amb
2026-09-03 12:42:39 +08:00
commit 482bece22e
3726 changed files with 416708 additions and 0 deletions
@@ -0,0 +1,175 @@
<?php
/*
* This file is part of the overtrue/wechat.
*
* (c) overtrue <i@overtrue.me>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace TuzhiEasyWeChat\Channels\Aftersale;
use TuzhiEasyWeChat\Kernel\BaseClient;
use TuzhiEasyWeChat\Kernel\Exceptions\InvalidArgumentException;
/**
* Class Client.
*
* @author mingyoung <mingyoungcheung@gmail.com>
*/
class Client extends BaseClient
{
/**
* 获取售后单
* 通过该接口可以获取视频号小店的售后单。
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
*
*
* @param $after_sale_order_id String 是 售后单号
*
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function getAfterSaleorder($after_sale_order_id)
{
$params = [
'after_sale_order_id' => $after_sale_order_id
];
return $this->httpPostJson('channels/ec/aftersale/getaftersaleorder', $params);
}
/**
* 获取售后单列表
* 通过该接口可以获取视频号小店的售后单列表。
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
* @param $begin_create_time Number 是 订单创建启始时间
* @param $end_create_time Number 是 订单创建结束时间,end_create_time减去begin_create_time不得大于24小时
* @param $next_key String 否 翻页参数,从第二页开始传,来源于上一页的返回值
*
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function getAftersaleList($begin_create_time,$end_create_time,$next_key='')
{
$params = [
'begin_create_time' => $begin_create_time,
'end_create_time' => $end_create_time
];
if($next_key){
$params['next_key'] = $next_key;
}
return $this->httpPostJson('channels/ec/aftersale/getaftersalelist', $params);
}
/**
* 同意售后
* 通过该接口可以在视频号小店售后管理中进行同意售后操作。
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
* @param $after_sale_order_id String 是 售后单号
* @param $address_id String 否 同意退货时必须传入地址id,否则后续接口在处理缺少地址信息的请求时将报错
* @param $accept_type Number 否 针对退货退款同意售后的阶段:
1. 同意退货退款,并通知用户退货;
2. 确认收到货并退款给用户。
如果不填则将根据当前的售后单状态自动选择相应操作。对于仅退款的情况,由于只存在一种同意的场景,无需填写此字段。
*
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function acceptApply($begin_create_time,$address_id,$accept_type='')
{
$params = [
'begin_create_time' => $begin_create_time
];
if($accept_type){
$params['accept_type'] = $accept_type;
}
if($address_id){
$params['address_id'] = $address_id;
}
return $this->httpPostJson('channels/ec/aftersale/acceptapply', $params);
}
/**
* 拒绝售后
* 通过该接口可以在视频号小店售后管理中进行拒绝售后操作。
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
* @param $after_sale_order_id String 是 售后单号
* @param $reject_reason String 否 拒绝原因具体描述 ,可使用默认描述,也可以自定义描述
* @param $reject_reason_type number 是 拒绝原因枚举值
*
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function rejectApply($after_sale_order_id,$reject_reason_type,$reject_reason='')
{
$params = [
'after_sale_order_id' => $after_sale_order_id,
'reject_reason_type'=>$reject_reason_type
];
if($reject_reason){
$params['reject_reason'] = $reject_reason;
}
return $this->httpPostJson('channels/ec/aftersale/rejectapply', $params);
}
/**
* 上传退款凭证
* 通过该接口可以将退款凭证上传至视频号小店。
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
* @param $after_sale_order_id String 是 售后单号
* @param $refund_certificates Array<String> 是 退款凭证,可使用图片上传接口获取media_id(数据类型填0)
* @param $desc String 是 描述
*
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function uploadRefundCertificate($after_sale_order_id,$refund_certificates,$desc)
{
$params = [
'desc' => $desc,
'after_sale_order_id' => $after_sale_order_id,
'refund_certificates' => $refund_certificates
];
return $this->httpPostJson('channels/ec/aftersale/uploadrefundcertificate', $params);
}
/**
* 获取全量售后原因
* 通过该接口可以获取视频号小店的全量售后原因。
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function getReason()
{
$params = [];
return $this->httpPostJson('channels/ec/aftersale/reason/get', $params);
}
/**
* 获取拒绝售后原因
* 通过该接口可以获取视频号小店的拒绝售后原因。
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function getRejectReason()
{
$params = [];
return $this->httpPostJson('channels/ec/aftersale/rejectreason/get', $params);
}
}