初始版本

This commit is contained in:
贾祥聪
2025-08-19 14:16:51 +08:00
commit f937a1f9b9
4373 changed files with 359728 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\coachapi\controller;
use app\common\controller\BaseLikeShopController;
class BaseCoachController extends BaseLikeShopController
{
protected int $coachId = 0;
protected int $coachUserId = 0;
protected array $coachInfo = [];
public function initialize()
{
if (isset($this->request->coachInfo) && $this->request->coachInfo) {
$this->coachInfo = $this->request->coachInfo;
$this->coachId = $this->coachInfo['coach_id'] ?? 0;
$this->coachUserId = $this->coachInfo['coach_user_id'] ?? 0;
}
}
}

View File

@@ -0,0 +1,75 @@
<?php
namespace app\coachapi\controller;
use app\api\controller\BaseApiController;
use app\coachapi\logic\CityLogic;
class CityController extends BaseCoachController
{
/**
* @notes 获取城市列表
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author cjhao
* @date 2024/10/6 17:50
*/
public function getCityLists()
{
$lists = (new CityLogic())->getCityLists();
return $this->success('',$lists);
}
/**
* @notes 搜索附近地址
* @return \think\response\Json
* @author ljj
* @date 2024/7/23 上午11:21
*/
public function getNearbyLocation()
{
$params = $this->request->get();
$result = (new CityLogic())->getNearbyLocation($params);
if ($result['status'] !== 0) {
return $this->fail($result['message']);
}
return $this->success('',$result);
}
/**
* @notes 地级市列表
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/4/6 2:41 下午
*/
public function city()
{
$params = $this->request->get();
$result = (new CityLogic())->city($params);
return $this->success('获取成功',$result);
}
/**
* @notes 逆地址解析(坐标位置描述)
* @return \think\response\Json
* @author ljj
* @date 2022/10/13 2:44 下午
* 本接口提供由经纬度到文字地址及相关位置信息的转换能力
*/
public function geocoderCoordinate()
{
$get = $this->request->get();
if (!isset($get['location']) || $get['location'] == '') {
return $this->fail('经纬度缺失');
}
$result = (new CityLogic())->geocoderCoordinate($get);
if ($result['status'] !== 0) {
return $this->fail($result['message']);
}
return $this->success('',$result);
}
}

View File

@@ -0,0 +1,250 @@
<?php
namespace app\coachapi\controller;
use app\coachapi\lists\CoachOrderLists;
use app\coachapi\lists\GoodsLists;
use app\coachapi\logic\CoachLogic;
use app\coachapi\validate\CoachValidate;
/**
* 技师控制器类
* Class CoachController
* @package app\coachapi\controller
*/
class CoachController extends BaseCoachController
{
/**
* @notes 个人中心
* @return \think\response\Json
* @author cjhao
* @date 2024/8/23 16:09
*/
public function center()
{
$result = (new CoachLogic())->center($this->coachInfo);
return $this->success('',$result);
}
/**
* @notes 个人中心
* @return \think\response\Json
* @author cjhao
* @date 2024/8/23 16:09
*/
public function info()
{
$result = (new CoachLogic())->info($this->coachId);
return $this->success('',$result);
}
/**
* @notes 技能列表
* @return \think\response\Json
* @author cjhao
* @date 2024/8/20 17:45
*/
public function skillLists()
{
$lists = (new CoachLogic())->skillLists();
return $this->success('',$lists);
}
/**
* @notes 获取服务列表
* @return \think\response\Json
* @author cjhao
* @date 2024/10/13 01:55
*/
public function goodsLists()
{
return $this->dataLists((new GoodsLists()));
}
/**
* @notes 数据列表
* @return \think\response\Json
* @author cjhao
* @date 2024/8/21 18:13
*/
public function otherLists()
{
$dataLists = (new CoachLogic())->otherLists();
return $this->success('',$dataLists);
}
/**
* @notes 申请技师接口
* @return \think\response\Json
* @author cjhao
* @date 2024/8/23 17:19
*/
public function apply()
{
$params = (new CoachValidate())->post()->goCheck('apply',['coach_id'=>$this->coachId]);
$params['coach_id'] = $this->coachId;
$params['coach_user_id'] = $this->coachUserId;
$result = (new CoachLogic())->apply($params);
if(true === $result){
return $this->success('申请成功,请等待平台审核');
}
return $this->fail($result);
}
/**
* @notes 详情
* @return \think\response\Json
* @author cjhao
* @date 2024/8/21 15:29
*/
public function detail()
{
$result = (new CoachLogic())->detail($this->coachUserId);
return $this->success('',$result);
}
/**
* @notes 更新资料
* @return \think\response\Json
* @author cjhao
* @date 2024/8/28 10:05
*/
public function updateInfo()
{
$params = (new CoachValidate())->post()->goCheck('update');
$params['coach_id'] = $this->coachId;
$params['coach_user_id'] = $this->coachUserId;
$result = (new CoachLogic())->updateInfo($params);
if(true === $result){
return $this->success('提交成功,请等待平台审核',[],1,1);
}
return $this->fail($result);
}
/**
* @notes 获取技师资料详情
* @return \think\response\Json
* @author cjhao
* @date 2024/11/26 17:12
*/
public function updateInfoDetail()
{
$result = (new CoachLogic())->updateInfoDetail($this->coachUserId);
return $this->success('',$result);
}
/**
* @notes 更新技师位置
* @return \think\response\Json
* @author cjhao
* @date 2024/8/29 16:00
*/
public function updateLocation()
{
$get = $this->request->get();
if (!isset($get['latitude']) || $get['longitude'] == '') {
return $this->fail('请上传位置');
}
$result = (new CoachLogic())->updateLocation($get,$this->coachId);
if(true === $result){
return $this->success('位置更新成功');
}
return $this->fail($result);
}
/**
* @notes 更新技师状态
* @return \think\response\Json
* @author cjhao
* @date 2024/8/29 16:29
*/
public function updateWorkStatus()
{
(new CoachLogic())->updateWorkStatus($this->coachId);
return $this->success('状态更新成功');
}
/**
* @notes 获取技师服务时间
* @return \think\response\Json
* @author cjhao
* @date 2024/8/29 18:36
*/
public function getServerTime()
{
$result = (new CoachLogic())->getServerTime($this->coachId);
return $this->success('',$result);
}
/**
* @notes 设置技师服务时间
* @return \think\response\Json
* @author cjhao
* @date 2024/9/2 17:28
*/
public function setServerTime()
{
$params = $this->request->post();
$result = (new CoachLogic())->setServerTime($params,$this->coachId);
if(true === $result){
return $this->success('设置成功');
}
return $this->fail($result);
}
/**
* @notes 订单列表
* @return \think\response\Json
* @author cjhao
* @date 2024/9/23 02:25
*/
public function orderLists()
{
return $this->dataLists((new CoachOrderLists()));
}
/**
* @notes 个人资料
* @return \think\response\Json
* @author ljj
* @date 2024/12/3 下午3:52
*/
public function personalData()
{
$result = (new CoachLogic())->personalData($this->coachId);
return $this->success('',$result);
}
/**
* @notes 设置个人资料
* @return \think\response\Json
* @author ljj
* @date 2024/12/3 下午3:57
*/
public function setPersonalData()
{
$params = (new CoachValidate())->post()->goCheck('setPersonalData', ['coach_id' => $this->coachId]);
(new CoachLogic)->setPersonalData($params);
return $this->success('操作成功', [],1,1);
}
/**
* @notes 绑定手机号
* @return \think\response\Json
* @author Tab
* @date 2021/8/25 17:46
*/
public function bindMobile()
{
$params = (new CoachValidate())->post()->goCheck('bindMobile',['coach_id'=>$this->coachId]);
$result = CoachLogic::bindMobile($params);
if($result === true) {
return $this->success('绑定成功', [], 1, 1);
}
return $this->fail($result);
}
}

View File

@@ -0,0 +1,49 @@
<?php
namespace app\coachapi\controller;
use app\coachapi\logic\ConfigLogic;
class ConfigController extends BaseCoachController
{
public array $notNeedLogin = ['config','agreement'];
/**
* @notes 基础配置信息
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/23 10:31 上午
*/
public function config()
{
$result = (new ConfigLogic())->config();
return $this->success('获取成功',$result);
}
/**
* @notes 政策协议
* @return \think\response\Json
* @author ljj
* @date 2022/2/23 11:42 上午
*/
public function agreement()
{
$result = (new ConfigLogic())->agreement();
return $this->success('获取成功',$result);
}
/**
* @notes 获取客服配置
* @return \think\response\Json
* @author cjhao
* @date 2024/11/1 18:16
*/
public function getKefuConfig()
{
$result = (new ConfigLogic())->getKefuConfig();
return $this->success('',$result);
}
}

View File

@@ -0,0 +1,51 @@
<?php
namespace app\coachapi\controller;
use app\coachapi\logic\DecorateLogic;
/**
* 装修风格控制器类
* Class DecorateController
* @package app\api\controller
*/
class DecorateController extends BaseCoachController
{
public array $notNeedLogin = ['page','style','tabbar'];
/**
* @notes 获取装修页面
* @return \think\response\Json
* @author cjhao
* @date 2024/10/8 15:13
*/
public function page()
{
$type = $this->request->get('type',1);
$detail = (new DecorateLogic())->page($type);
return $this->success('',$detail);
}
/**
* @notes 获取装修风格
* @return \think\response\Json
* @author cjhao
* @date 2024/10/8 15:14
*/
public function style()
{
$detail = (new DecorateLogic())->style();
return $this->success('',$detail);
}
/**
* @notes 底部菜单
* @return \think\response\Json
* @author cjhao
* @date 2024/10/8 15:57
*/
public function tabbar()
{
$detail = (new DecorateLogic())->tabbar();
return $this->success('',$detail);
}
}

View File

@@ -0,0 +1,42 @@
<?php
namespace app\coachapi\controller;
use app\coachapi\logic\DepositLogic;
/**
* 保证金控制器类
* Class CoachController
* @package app\coachapi\controller
*/
class DepositController extends BaseCoachController
{
/**
* @notes 获取保证金套餐
* @return \think\response\Json
* @author cjhao
* @date 2024/8/27 18:22
*/
public function depositPackage()
{
$result = (new DepositLogic())->depositPackage($this->coachUserId);
return $this->success('',$result);
}
/**
* @notes 提交订单
* @return \think\response\Json
* @author cjhao
* @date 2024/8/27 18:37
*/
public function sumbitOrder()
{
$params = $this->request->post();
$result = (new DepositLogic())->sumbitOrder($params,$this->coachId);
if(false === $result){
return $this->fail(DepositLogic::getError());
}
return $this->success('',$result);
}
}

View File

@@ -0,0 +1,51 @@
<?php
namespace app\coachapi\controller;
use app\coachapi\lists\WithdrawalLogLists;
use app\coachapi\logic\WithdrawLogic;
use app\coachapi\validate\WithdrawalApplyValidate;
/**
* 财务控制器类
* Class FinanceController
* @package app\coachapi\controller
*/
class FinanceController extends BaseCoachController
{
public function lists()
{
return $this->dataLists();
}
/**
* @notes 提现申请
* @return \think\response\Json
* @author cjhao
* @date 2024/9/26 15:13
*/
public function withdrawalApply()
{
$params = (new WithdrawalApplyValidate())->post()->goCheck('',['coach_id'=>$this->coachId]);
$result = (new WithdrawLogic())->withdrawalApply($params);
if(true === $result){
return $this->success('申请成功');
}
return $this->fail($result);
}
/**
* @notes 提现记录
* @return \think\response\Json
* @author cjhao
* @date 2024/9/27 01:34
*/
public function withdrawalLog()
{
return $this->dataLists(new WithdrawalLogLists());
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace app\coachapi\controller;
use app\coachapi\logic\GoodsCommentLogic;
/**
* 订单评论金控制器类
* Class CoachController
* @package app\coachapi\controller
*/
class GoodsCommentController extends BaseCoachController
{
/**
* @notes 服务评价分类
* @return \think\response\Json
* @author ljj
* @date 2022/2/18 2:10 下午
*/
public function commentCategory()
{
$result = (new GoodsCommentLogic())->commentCategory($this->coachId);
return $this->success('',$result);
}
public function lists()
{
return $this->dataLists();
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace app\coachapi\controller;
use app\coachapi\logic\GoodsLogic;
/**
* 服务控制器类
* Class CoachController
* @package app\coachapi\controller
*/
class GoodsController extends BaseCoachController
{
public function lists()
{
return $this->dataLists();
}
/**
* @notes 获取详情接口
* @return \think\response\Json
* @author cjhao
* @date 2024/11/27 14:38
*/
public function detail()
{
$params = $this->request->get();
$result = (new GoodsLogic())->detail($params['id']);
return $this->success('',$result);
}
}

View File

@@ -0,0 +1,116 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\coachapi\controller;
use app\coachapi\validate\{LoginAccountValidate, PasswordValidate, RegisterValidate};
use app\coachapi\logic\LoginLogic;
/**
* 登录注册
* Class LoginController
* @package app\coachapi\controller
*/
class LoginController extends BaseCoachController
{
public array $notNeedLogin = ['register', 'account', 'logout','resetPassword'];
/**
* @notes 注册账号
* @return \think\response\Json
* @author 段誉
* @date 2022/9/7 15:38
*/
public function register()
{
$params = (new RegisterValidate())->post()->goCheck('register');
$result = LoginLogic::register($params);
if (true === $result) {
return $this->success('注册成功', [], 1, 1);
}
return $this->fail(LoginLogic::getError());
}
/**
* @notes 账号密码/手机号密码/手机号验证码登录
* @return \think\response\Json
* @author 段誉
* @date 2022/9/16 10:42
*/
public function account()
{
$params = (new LoginAccountValidate())->post()->goCheck();
$result = LoginLogic::login($params);
if (false === $result) {
return $this->fail(LoginLogic::getError());
}
return $this->data($result);
}
/**
* @notes 退出登录
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/9/16 10:42
*/
public function logout()
{
LoginLogic::logout($this->coachInfo);
return $this->success();
}
/**
* @notes 重置密码
* @return \think\response\Json
* @author 段誉
* @date 2022/9/16 18:06
*/
public function resetPassword()
{
$params = (new PasswordValidate())->post()->goCheck('resetPassword');
$result = (new LoginLogic())->resetPassword($params);
if (true === $result) {
return $this->success('操作成功', [], 1, 1);
}
return $this->fail(LoginLogic::getError());
}
/**
* @notes 修改密码
* @return \think\response\Json
* @author cjhao
* @date 2024/11/27 09:46
*/
public function changePassword()
{
$params = (new PasswordValidate())->post()->goCheck('changePassword',['coach_info'=>$this->coachInfo]);
// $params['coach_info'] = $this->coachInfo;
$result = (new LoginLogic())->changePassword($params);
if (true === $result) {
return $this->success('操作成功', [], 1, 1);
}
return $this->fail(LoginLogic::getError());
}
}

View File

@@ -0,0 +1,147 @@
<?php
namespace app\coachapi\controller;
use app\coachapi\lists\IncomeLists;
use app\coachapi\logic\OrderLogic;
use app\coachapi\validate\OrderValidate;
use app\common\logic\PayNotifyLogic;
/**
* 订单控制器类
* Class OrderController
* @package app\coachapi\controller
*/
class OrderController extends BaseCoachController
{
public array $notNeedLogin = ['test'];
/**
* @notes 订单列表
* @return \think\response\Json
* @author cjhao
* @date 2024/9/16 21:14
*/
public function lists()
{
return $this->dataLists();
}
/**
* @notes 订单详情
* @return \think\response\Json
* @author cjhao
* @date 2024/9/20 02:18
*/
public function detail()
{
$id = $this->request->get('id');
$result = (new OrderLogic())->detail($id);
return $this->success('', $result);
}
/**
* @notes 接单操作
* @return \think\response\Json
* @author cjhao
* @date 2024/9/13 17:23
*/
public function take()
{
$params = (new OrderValidate())->post()->goCheck('',['coach_id'=>$this->coachId]);
$result = (new OrderLogic())->take($params);
if (true === $result) {
return $this->success('接单成功', ['msg'=>'接单成功'], 1, 0);
}
return $this->success(OrderLogic::getError(), ['msg'=>OrderLogic::getError()], 1, 0);
}
/**
* @notes 出发操作
* @return \think\response\Json
* @author cjhao
* @date 2024/9/13 17:24
*/
public function depart()
{
$params = (new OrderValidate())->post()->goCheck('',['coach_id'=>$this->coachId]);
$result = (new OrderLogic())->depart($params);
if (true === $result) {
return $this->success('操作成功', [], 1, 1);
}
return $this->fail(OrderLogic::getError());
}
/**
* @notes 达到操作
* @return \think\response\Json
* @author cjhao
* @date 2024/9/13 17:24
*/
public function arrive()
{
$params = (new OrderValidate())->post()->goCheck('',['coach_id'=>$this->coachId]);
$result = (new OrderLogic())->arrive($params);
if (true === $result) {
return $this->success('操作成功', [], 1, 0);
}
return $this->fail(OrderLogic::getError());
}
/**
* @notes 服务开始
* @return \think\response\Json
* @author cjhao
* @date 2024/9/14 14:47
*/
public function startServer()
{
$params = (new OrderValidate())->post()->goCheck('',['coach_id'=>$this->coachId]);
$result = (new OrderLogic())->startServer($params);
if (true === $result) {
return $this->success('操作成功', [], 1, 1);
}
return $this->fail(OrderLogic::getError());
}
/**
* @notes 服务完成
* @return \think\response\Json
* @author cjhao
* @date 2024/9/14 14:53
*/
public function finishServer()
{
$params = (new OrderValidate())->post()->goCheck('',['coach_id'=>$this->coachId]);
$result = (new OrderLogic())->finishServer($params);
if (true === $result) {
return $this->success('操作成功', [], 1, 0);
}
return $this->fail(OrderLogic::getError());
}
/**
* @notes 收入列表
* @return \think\response\Json
* @author cjhao
* @date 2024/11/5 18:11
*/
public function incomeLists()
{
return $this->dataLists((new IncomeLists()));
}
public function test()
{
// PayNotifyLogic::handle('deposit', 202411290022494214, []);
}
}

View File

@@ -0,0 +1,127 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\coachapi\controller;
use app\coachapi\logic\PayLogic;
use app\coachapi\validate\PayValidate;
use app\common\enum\user\UserTerminalEnum;
use app\common\service\AliPayService;
use app\common\service\WeChatPayService;
class PayController extends BaseCoachController
{
public array $notNeedLogin = ['notifyMnp','notifyOa','aliNotify'];
/**
* @notes 支付方式
* @return \think\response\Json
* @author ljj
* @date 2022/2/28 2:56 下午
*/
public function payWay()
{
$params = (new PayValidate())->get()->goCheck('payWay',['coach_id'=>$this->coachId]);
$result = PayLogic::payWay($params);
if ($result === false) {
return $this->fail(PayLogic::getError());
}
return $this->data($result);
}
/**
* @notes 预支付
* @return \think\response\Json
* @throws \Exception
* @author ljj
* @date 2022/3/1 11:20 上午
*/
public function prepay()
{
$params = (new PayValidate())->post()->goCheck('prepay');
//支付流程
$result = PayLogic::pay($params['pay_way'], $params['from'], $params['order_id'], $this->coachInfo['terminal'],$params['code'] ?? '');
if (false === $result) {
return $this->fail(PayLogic::getError(), $params);
}
return $this->success('', $result);
}
/**
* @notes 小程序支付回调
* @return \Symfony\Component\HttpFoundation\Response
* @author 段誉
* @date 2021/8/13 14:17
*/
public function notifyMnp()
{
return (new WeChatPayService(UserTerminalEnum::WECHAT_MMP))->notify();
}
/**
* @notes 公众号支付回调
* @return \Symfony\Component\HttpFoundation\Response
* @author 段誉
* @date 2021/8/13 14:17
*/
public function notifyOa()
{
return (new WeChatPayService(UserTerminalEnum::WECHAT_OA))->notify();
}
/**
* @notes 支付宝回调
* @return bool
* @author 段誉
* @date 2021/8/13 14:16
*/
public function aliNotify()
{
$params = $this->request->post();
$result = (new AliPayService())->notify($params);
if (true === $result) {
echo 'success';
} else {
echo 'fail';
}
}
/**
* @notes 获取支付结果
* @return \think\response\Json
* @author ljj
* @date 2024/3/21 5:49 下午
*/
public function getPayResult()
{
$params = (new PayValidate())->get()->goCheck('getPayResult');
//支付流程
$result = PayLogic::getPayResult($params);
if (false === $result) {
return $this->fail(PayLogic::getError());
}
return $this->success('', $result);
}
}

View File

@@ -0,0 +1,99 @@
<?php
namespace app\coachapi\controller;
use app\coachapi\logic\ShopLogic;
use app\coachapi\validate\PasswordValidate;
class ShopController extends BaseCoachController
{
public function lists()
{
return $this->dataLists();
}
/**
* @notes 店铺详情
* @return \think\response\Json
* @author cjhao
* @date 2024/10/12 00:26
*/
public function detail()
{
$params = $this->request->get();
$params['coach_id'] = $this->coachId;
$detail = (new ShopLogic())->detail($params);
return $this->success('',$detail);
}
/**
* @notes 申请
* @return \think\response\Json
* @author cjhao
* @date 2024/10/14 11:51
*/
public function applyJoin()
{
$params = $this->request->post();
$params['coach_id'] = $this->coachId;
$result = (new ShopLogic())->applyJoin($params);
if(true === $result){
return $this->success('申请成功,请等待门店审核',[],1,1);
}
return $this->fail(ShopLogic::getError());
}
/**
* @notes 申请列表
* @return \think\response\Json
* @author cjhao
* @date 2024/10/20 03:44
*/
public function applyDetail()
{
$params = $this->request->get();
$params['coach_id'] = $this->coachId;
$result = (new ShopLogic())->applyDetail($params);
return $this->success('',$result);
}
/**
* @notes 取消申请
* @return \think\response\Json
* @author cjhao
* @date 2024/10/20 23:03
*/
public function cancel()
{
$params = $this->request->post();
$params['coach_id'] = $this->coachId;
$result = (new ShopLogic())->cancel($params);
if(true === $result){
return $this->success('取消成功');
}
return $this->fail($result);
}
/**
* @notes 申请
* @return \think\response\Json
* @author cjhao
* @date 2024/10/14 11:51
*/
public function applyQuit()
{
// $params = $this->request->post();
// $params['coach_id'] = $this->coachId;
$result = (new ShopLogic())->applyQuit($this->coachId);
if(true === $result){
return $this->success('申请成功,请等待门店审核');
}
return $this->fail(ShopLogic::getError());
}
}

View File

@@ -0,0 +1,48 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\coachapi\controller;
use app\coachapi\logic\SmsLogic;
use app\coachapi\validate\SendSmsValidate;
/**
* 短信
* Class SmsController
* @package app\coachapi\controller
*/
class SmsController extends BaseCoachController
{
public array $notNeedLogin = ['sendCode'];
/**
* @notes 发送短信验证码
* @return \think\response\Json
* @author 段誉
* @date 2022/9/15 16:17
*/
public function sendCode()
{
$params = (new SendSmsValidate())->post()->goCheck();
$result = SmsLogic::sendCode($params);
if (true === $result) {
return $this->success('发送成功');
}
return $this->fail(SmsLogic::getError());
}
}

View File

@@ -0,0 +1,48 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\coachapi\controller;
use app\common\enum\FileEnum;
use app\common\service\UploadService;
use Exception;
use think\response\Json;
/** 上传文件
* Class UploadController
* @package app\api\controller
*/
class UploadController extends BaseCoachController
{
/**
* @notes 上传图片
* @return Json
* @author 段誉
* @date 2022/9/20 18:11
*/
public function image()
{
try {
$result = UploadService::image(0, $this->coachId,FileEnum::SOURCE_COACH);
return $this->success('上传成功', $result);
} catch (Exception $e) {
return $this->fail($e->getMessage());
}
}
}

View File

@@ -0,0 +1,46 @@
<?php
// +----------------------------------------------------------------------
// | LikeShop有特色的全开源社交分销电商系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 商业用途务必购买系统授权,以免引起不必要的法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | 微信公众号:好象科技
// | 访问官网http://www.likemarket.net
// | 访问社区http://bbs.likemarket.net
// | 访问手册http://doc.likemarket.net
// | 好象科技开发团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | Author: LikeShopTeam
// +----------------------------------------------------------------------
namespace app\coachapi\controller;
use app\coachapi\controller\BaseCoachController;
use app\coachapi\logic\WechatLogic;
use app\coachapi\validate\WechatValidate;
/**
* 微信控制器
* Class WechatController
* @package app\api\controller
*/
class WechatController extends BaseCoachController
{
public array $notNeedLogin = ['jsConfig'];
/**
* @notes 微信JSSDK授权接口
* @return \think\response\Json
* @author Tab
* @date 2021/8/30 19:20
*/
public function jsConfig()
{
$params = (new WechatValidate())->goCheck('jsConfig');
$result = WechatLogic::jsConfig($params);
if ($result === false) {
return $this->fail(WechatLogic::getError());
}
return $this->data($result);
}
}

View File

@@ -0,0 +1,110 @@
<?php
namespace app\coachapi\controller;
use app\coachapi\lists\WithdrawalLogLists;
use app\coachapi\logic\WithdrawLogic;
/**
* 提现列表
* Class WithdrawController
* @package app\coachapi\controller
*/
class WithdrawController extends BaseCoachController
{
public function configLists()
{
$lists = (new WithdrawLogic())->configLists($this->coachId);
return $this->success('',$lists);
}
/**
* @notes 获取提现配置
* @return \think\response\Json
* @author cjhao
* @date 2024/9/26 00:09
*/
public function getWithDrawWay()
{
$type = $this->request->get('type',1);
$lists = (new WithdrawLogic())->getWithDrawWay($this->coachId,$type);
return $this->success('',$lists);
}
/**
* @notes 设置提现配置
* @return \think\response\Json
* @author cjhao
* @date 2024/9/26 00:24
*/
public function setWithDrawWay()
{
$post = $this->request->post();
$result = (new WithdrawLogic())->setWithDrawWay($this->coachId,$post);
if(true === $result){
return $this->success('设置成功',[],1,1);
}
return $this->fail($result);
}
/**
* @notes 获取提现配置
* @return \think\response\Json
* @author cjhao
* @date 2024/10/29 17:21
*/
public function getWithdrawInfo()
{
$result = (new WithdrawLogic())->getWithdrawInfo($this->coachId);
return $this->success('',$result,1,1);
}
/**
* @notes 提现
* @return \think\response\Json
* @author cjhao
* @date 2024/10/29 18:00
*/
public function apply(){
$params = $this->request->post();
$params['coach_id'] = $this->coachId;
$result = (new WithdrawLogic())->apply($params);
if(true === $result){
return $this->success('申请提现成功,请等待审核');
}
return $this->fail(WithdrawLogic::getError());
}
/**
* @notes 记录列表
* @return \think\response\Json
* @author cjhao
* @date 2024/10/30 23:46
*/
public function logLists()
{
return $this->dataLists((new WithdrawalLogLists()));
}
/**
* @notes 提现详情
* @return \think\response\Json
* @throws \Exception
* @author cjhao
* @date 2024/10/31 09:07
*/
public function detail()
{
$id = $this->request->get('id');
$result = (new WithdrawLogic())->detail($id,$this->coachId);
return $this->success('',$result);
}
}