初始版本
This commit is contained in:
42
server/app/shopapi/controller/BaseShopController.php
Executable file
42
server/app/shopapi/controller/BaseShopController.php
Executable 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\shopapi\controller;
|
||||
|
||||
|
||||
use app\common\controller\BaseLikeShopController;
|
||||
|
||||
class BaseShopController extends BaseLikeShopController
|
||||
{
|
||||
protected int $shopId = 0;
|
||||
protected int $shopUserId = 0;
|
||||
protected array $shopInfo = [];
|
||||
|
||||
|
||||
public function initialize()
|
||||
{
|
||||
|
||||
if (isset($this->request->shopInfo) && $this->request->shopInfo) {
|
||||
$this->shopInfo = $this->request->shopInfo;
|
||||
$this->shopId = $this->shopInfo['shop_id'] ?? 0;
|
||||
$this->shopUserId = $this->shopInfo['shop_user_id'] ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
88
server/app/shopapi/controller/CityController.php
Executable file
88
server/app/shopapi/controller/CityController.php
Executable file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
use app\shopapi\logic\CityLogic;
|
||||
|
||||
/**
|
||||
* 城市控制器类
|
||||
* Class CityController
|
||||
* @package app\shopapi\controller
|
||||
*/
|
||||
class CityController extends BaseShopController
|
||||
{
|
||||
|
||||
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
|
||||
* @author cjhao
|
||||
* @date 2024/9/3 17:34
|
||||
*/
|
||||
public function getNearbyCity()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$result = (new CityLogic())->getNearbyCity($params);
|
||||
if(false === $result){
|
||||
return $this->fail(CityLogic::getError());
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
147
server/app/shopapi/controller/CoachController.php
Executable file
147
server/app/shopapi/controller/CoachController.php
Executable file
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
|
||||
use app\shopapi\lists\ShopCoachLists;
|
||||
use app\shopapi\logic\CoachLogic;
|
||||
use app\shopapi\lists\CoachApplyLists;
|
||||
use app\shopapi\logic\ShopLogic;
|
||||
use app\shopapi\validate\ShopApplyValidate;
|
||||
|
||||
/**
|
||||
* 技师控制器类
|
||||
* Class CoachController
|
||||
* @package app\shopapi\controller
|
||||
*/
|
||||
class CoachController extends BaseShopController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取技师信息
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/12/8 22:22
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$result = (new CoachLogic())->info($id,$this->shopId);
|
||||
if(false === $result){
|
||||
return $this->success(CoachLogic::getError());
|
||||
}
|
||||
return $this->success('',$result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 门店技师列表
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/19 10:43
|
||||
*/
|
||||
public function shopCoachLists()
|
||||
{
|
||||
return $this->dataLists(new ShopCoachLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 申请列表
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/15 20:35
|
||||
*/
|
||||
public function applyLists()
|
||||
{
|
||||
return $this->dataLists((new CoachApplyLists()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 申请详情
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/16 02:02
|
||||
*/
|
||||
public function applyDetail()
|
||||
{
|
||||
$id = $this->request->get('id',0);
|
||||
$result = (new CoachLogic())->applyDetail($id);
|
||||
if(false === $result){
|
||||
return $this->success(CoachLogic::getError());
|
||||
}
|
||||
return $this->success('',$result);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 技师申请审核
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/16 00:06
|
||||
*/
|
||||
public function applyAudit()
|
||||
{
|
||||
$params = (new ShopApplyValidate())->post()->goCheck('',['shop_id'=>$this->shopId]);
|
||||
$result = (new CoachLogic())->applyAudit($params);
|
||||
if(true === $result){
|
||||
return $this->success('操作成功');
|
||||
}
|
||||
return $this->fail($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取师傅服务时间
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/8/29 18:36
|
||||
*/
|
||||
public function getServerTime()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$result = (new CoachLogic())->getServerTime($id);
|
||||
if(is_array($result)){
|
||||
return $this->success('',$result);
|
||||
}
|
||||
return $this->fail($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置技师服务时间
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/9/2 17:28
|
||||
*/
|
||||
public function setServerTime()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$params['shop_id'] = $this->shopId;
|
||||
$result = (new ShopLogic())->setServerTime($params);
|
||||
if(true === $result){
|
||||
return $this->success('设置成功');
|
||||
}
|
||||
return $this->fail($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置技师服务时间
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/9/2 17:28
|
||||
*/
|
||||
public function setWorkStatus()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$params['shop_id'] = $this->shopId;
|
||||
$result = (new ShopLogic())->setWorkStatus($params);
|
||||
if(true === $result){
|
||||
return $this->success('设置成功');
|
||||
}
|
||||
return $this->fail($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
50
server/app/shopapi/controller/ConfigController.php
Executable file
50
server/app/shopapi/controller/ConfigController.php
Executable file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
use app\shopapi\logic\ConfigLogic;
|
||||
|
||||
class ConfigController extends BaseShopController
|
||||
{
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
52
server/app/shopapi/controller/DecorateController.php
Executable file
52
server/app/shopapi/controller/DecorateController.php
Executable file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
use app\api\controller\BaseApiController;
|
||||
use app\shopapi\logic\DecorateLogic;
|
||||
|
||||
/**
|
||||
* 装修风格控制器类
|
||||
* Class DecorateController
|
||||
* @package app\api\controller
|
||||
*/
|
||||
class DecorateController extends BaseShopController
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
42
server/app/shopapi/controller/DepositController.php
Executable file
42
server/app/shopapi/controller/DepositController.php
Executable file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
|
||||
use app\shopapi\logic\DepositLogic;
|
||||
|
||||
/**
|
||||
* 保证金控制器类
|
||||
* Class CoachController
|
||||
* @package app\coachapi\controller
|
||||
*/
|
||||
class DepositController extends BaseShopController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取保证金套餐
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/8/27 18:22
|
||||
*/
|
||||
public function depositPackage()
|
||||
{
|
||||
$result = (new DepositLogic())->depositPackage($this->shopUserId);
|
||||
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->shopId);
|
||||
if(false === $result){
|
||||
return $this->fail(DepositLogic::getError());
|
||||
}
|
||||
return $this->success('',$result);
|
||||
|
||||
}
|
||||
}
|
||||
22
server/app/shopapi/controller/FinanceController.php
Executable file
22
server/app/shopapi/controller/FinanceController.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
use app\shopapi\controller\BaseShopController;
|
||||
|
||||
/**
|
||||
* 财务控制器类
|
||||
* Class FinanceController
|
||||
* @package app\shopapi\controller
|
||||
*/
|
||||
class FinanceController extends BaseShopController
|
||||
{
|
||||
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
37
server/app/shopapi/controller/GoodsCommentController.php
Executable file
37
server/app/shopapi/controller/GoodsCommentController.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
|
||||
use app\shopapi\lists\CommentGoodsLists;
|
||||
use app\shopapi\logic\GoodsCommentLogic;
|
||||
|
||||
/**
|
||||
* 评论控制器类
|
||||
* Class GoodsCommentController
|
||||
* @package app\shopapi\controller
|
||||
*/
|
||||
class GoodsCommentController extends BaseShopController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 服务评价列表
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/18 11:24 上午
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new CommentGoodsLists());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 服务评价分类
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/18 2:10 下午
|
||||
*/
|
||||
public function commentCategory()
|
||||
{
|
||||
$result = (new GoodsCommentLogic())->commentCategory($this->shopId);
|
||||
return $this->success('',$result);
|
||||
}
|
||||
}
|
||||
157
server/app/shopapi/controller/GoodsController.php
Executable file
157
server/app/shopapi/controller/GoodsController.php
Executable file
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
use app\shopapi\lists\MyGoodsLists;
|
||||
use app\shopapi\lists\ShopGoodsLists;
|
||||
use app\shopapi\logic\GoodsLogic;
|
||||
use app\shopapi\validate\GoodsValidate;
|
||||
|
||||
/**
|
||||
* 服务控制器类
|
||||
* Class GoodsController
|
||||
* @package app\shopapi\controller
|
||||
*/
|
||||
class GoodsController extends BaseShopController
|
||||
{
|
||||
public array $notNeedLogin = ['detail'];
|
||||
|
||||
/**
|
||||
* @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/5 14:48
|
||||
*/
|
||||
public function categoryLists()
|
||||
{
|
||||
$lists = (new GoodsLogic())->categoryLists();
|
||||
return $this->success('',$lists);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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/16 16:47
|
||||
*/
|
||||
public function skillLists()
|
||||
{
|
||||
$lists = (new GoodsLogic())->skillLists();
|
||||
return $this->success('',$lists);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 服务列表
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/5 14:49
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加服务
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/16 17:38
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new GoodsValidate())->post()->goCheck('add',['shop_id'=>$this->shopId]);
|
||||
$result = (new GoodsLogic())->add($params);
|
||||
if(true === $result){
|
||||
return $this->success('添加成功,请等待管理员审核');
|
||||
}
|
||||
return $this->fail($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑服务
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/16 18:13
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new GoodsValidate())->post()->goCheck('',['shop_id'=>$this->shopId]);
|
||||
$result = (new GoodsLogic())->edit($params);
|
||||
if(true === $result){
|
||||
return $this->success('编辑成功,请等待管理员审核');
|
||||
}
|
||||
return $this->fail($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 我的项目列表
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/12/11 17:30
|
||||
*/
|
||||
public function myGoodsLists()
|
||||
{
|
||||
return $this->dataLists((new MyGoodsLists()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 门店服务列表
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/16 16:57
|
||||
*/
|
||||
public function shopGoodsLists()
|
||||
{
|
||||
return $this->dataLists((new ShopGoodsLists()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 查看服务详情
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/9 3:52 下午
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new GoodsValidate())->get()->goCheck('detail');
|
||||
$result = (new GoodsLogic())->detail($params['id']);
|
||||
return $this->success('获取成功',$result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除服务
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/9 4:13 下午
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$params = (new GoodsValidate())->post()->goCheck('del',['shop_id'=>$this->shopId]);
|
||||
$result = (new GoodsLogic())->del($params['id'],$this->shopId);
|
||||
if (true !== $result) {
|
||||
return $this->fail($result);
|
||||
}
|
||||
return $this->success('操作成功',[],1,1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 修改服务状态
|
||||
* @return \think\response\Json
|
||||
* @author ljj
|
||||
* @date 2022/2/9 4:55 下午
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
$params = (new GoodsValidate())->post()->goCheck('status');
|
||||
(new GoodsLogic)->status($params,$this->shopId);
|
||||
return $this->success('操作成功',[],1,1);
|
||||
}
|
||||
}
|
||||
19
server/app/shopapi/controller/IndexController.php
Executable file
19
server/app/shopapi/controller/IndexController.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
use app\shopapi\logic\IndexLogic;
|
||||
|
||||
class IndexController extends BaseShopController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 首页商家数据
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/11/12 17:55
|
||||
*/
|
||||
public function shopData()
|
||||
{
|
||||
$result = (new IndexLogic())->shopData($this->shopId);
|
||||
return $this->success('',$result);
|
||||
}
|
||||
}
|
||||
118
server/app/shopapi/controller/LoginController.php
Executable file
118
server/app/shopapi/controller/LoginController.php
Executable file
@@ -0,0 +1,118 @@
|
||||
<?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\shopapi\controller;
|
||||
use app\shopapi\validate\{LoginAccountValidate, PasswordValidate, RegisterValidate};
|
||||
use app\shopapi\logic\LoginLogic;
|
||||
|
||||
/**
|
||||
* 登录注册
|
||||
* Class LoginController
|
||||
* @package app\coachapi\controller
|
||||
*/
|
||||
class LoginController extends BaseShopController
|
||||
{
|
||||
|
||||
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(),[],LoginLogic::getReturnCode());
|
||||
}
|
||||
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->shopInfo);
|
||||
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',['shop_info'=>$this->shopInfo]);
|
||||
$params['shop_info'] = $this->shopInfo;
|
||||
$result = (new LoginLogic())->changePassword($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(LoginLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
90
server/app/shopapi/controller/OrderController.php
Executable file
90
server/app/shopapi/controller/OrderController.php
Executable file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
use app\shopapi\lists\CoachOrderLists;
|
||||
use app\shopapi\lists\IncomeLists;
|
||||
use app\shopapi\logic\OrderLogic;
|
||||
|
||||
|
||||
/**
|
||||
* 订单控制器类
|
||||
* Class OrderController
|
||||
* @package app\shopapi\controller
|
||||
*/
|
||||
class OrderController extends BaseShopController
|
||||
{
|
||||
|
||||
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/12/8 21:55
|
||||
*/
|
||||
public function coachOrderLists()
|
||||
{
|
||||
return $this->dataLists((new CoachOrderLists()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 收入列表
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/11/5 18:11
|
||||
*/
|
||||
public function incomeLists()
|
||||
{
|
||||
return $this->dataLists((new IncomeLists()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 订单更换技师时获取技师列表
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/9/29 10:25
|
||||
*/
|
||||
public function coachLists()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$result = (new OrderLogic())->coachLists($params,$this->shopId);
|
||||
if (false !== $result) {
|
||||
return $this->success('', $result);
|
||||
}
|
||||
return $this->fail(OrderLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 指派技师
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/10 23:05
|
||||
*/
|
||||
public function dispatchCoach()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$params['shop_id'] = $this->shopId;
|
||||
$result = (new OrderLogic())->dispatchCoach($params);
|
||||
if (false !== $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(OrderLogic::getError());
|
||||
}
|
||||
|
||||
}
|
||||
125
server/app/shopapi/controller/PayController.php
Executable file
125
server/app/shopapi/controller/PayController.php
Executable file
@@ -0,0 +1,125 @@
|
||||
<?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\shopapi\controller;
|
||||
use app\shopapi\logic\PayLogic;
|
||||
use app\shopapi\validate\PayValidate;
|
||||
use app\common\enum\user\UserTerminalEnum;
|
||||
use app\common\service\AliPayService;
|
||||
use app\common\service\WeChatPayService;
|
||||
|
||||
class PayController extends BaseShopController
|
||||
{
|
||||
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',['shop_id'=>$this->shopId]);
|
||||
$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->shopInfo['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);
|
||||
}
|
||||
}
|
||||
137
server/app/shopapi/controller/ShopController.php
Executable file
137
server/app/shopapi/controller/ShopController.php
Executable file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
use app\shopapi\logic\ShopLogic;
|
||||
use app\shopapi\validate\ShopValidate;
|
||||
|
||||
|
||||
class ShopController extends BaseShopController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 个人中心
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/20 03:11
|
||||
*/
|
||||
public function centre()
|
||||
{
|
||||
$result = (new ShopLogic())->centre($this->shopId);
|
||||
return $this->success('',$result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取商家信息
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/11/19 11:03
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
$result = (new ShopLogic())->info($this->shopId);
|
||||
return $this->success('',$result);
|
||||
}
|
||||
/**
|
||||
* @notes 申请
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/5 17:33
|
||||
*/
|
||||
public function apply()
|
||||
{
|
||||
$params = (new ShopValidate())->post()->goCheck('',$this->shopInfo);
|
||||
$result = (new ShopLogic())->apply($params);
|
||||
if(true === $result){
|
||||
return $this->success('申请成功,请等待管理员审核',[],1,1);
|
||||
}
|
||||
return $this->fail($result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 店铺详情
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/5 20:25
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$result = (new ShopLogic())->detail($this->shopUserId);
|
||||
return $this->success('',$result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 更新信息
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/6 12:13
|
||||
*/
|
||||
public function updateInfo()
|
||||
{
|
||||
$params = (new ShopValidate())->post()->goCheck('update',$this->shopInfo);
|
||||
$result = (new ShopLogic())->updateInfo($params);
|
||||
if ($result === true){
|
||||
return $this->success('提交成功,请等待管理员审核',[],1,1);
|
||||
}
|
||||
return $this->fail($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取更新资料接口
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/11/25 11:10
|
||||
*/
|
||||
public function updateInfoDetail(){
|
||||
$result = (new ShopLogic())->updateInfoDetail($this->shopUserId);
|
||||
return $this->success('',$result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置营业时间
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/22 09:25
|
||||
*/
|
||||
public function getBusiness()
|
||||
{
|
||||
$result = (new ShopLogic())->getBusiness($this->shopId);
|
||||
return $this->success('',$result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置营业时间
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/22 09:25
|
||||
*/
|
||||
public function setBusiness()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$params['shop_id'] = $this->shopId;
|
||||
(new ShopLogic())->setBusiness($params);
|
||||
return $this->success('设置成功',[],1,1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 绑定手机号
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
* @date 2021/8/25 17:46
|
||||
*/
|
||||
public function bindMobile()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$params['shop_id'] = $this->shopId;
|
||||
$result = (new ShopLogic())->bindMobile($params);
|
||||
if($result === true) {
|
||||
return $this->success('绑定成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail($result);
|
||||
}
|
||||
}
|
||||
47
server/app/shopapi/controller/SmsController.php
Executable file
47
server/app/shopapi/controller/SmsController.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?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\shopapi\controller;
|
||||
use app\shopapi\logic\SmsLogic;
|
||||
use app\shopapi\validate\SendSmsValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 短信
|
||||
* Class SmsController
|
||||
* @package app\api\controller
|
||||
*/
|
||||
class SmsController extends BaseShopController
|
||||
{
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
49
server/app/shopapi/controller/UploadController.php
Executable file
49
server/app/shopapi/controller/UploadController.php
Executable file
@@ -0,0 +1,49 @@
|
||||
<?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\shopapi\controller;
|
||||
|
||||
use app\coachapi\controller\BaseCoachController;
|
||||
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 BaseShopController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 上传图片
|
||||
* @return Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/20 18:11
|
||||
*/
|
||||
public function image()
|
||||
{
|
||||
try {
|
||||
$result = UploadService::image(0, $this->shopId,FileEnum::SOURCE_SHOP);
|
||||
return $this->success('上传成功', $result);
|
||||
} catch (Exception $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
113
server/app/shopapi/controller/WithdrawController.php
Executable file
113
server/app/shopapi/controller/WithdrawController.php
Executable file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
namespace app\shopapi\controller;
|
||||
use app\shopapi\lists\WithdrawalLogLists;
|
||||
use app\shopapi\logic\WithdrawLogic;
|
||||
|
||||
/**
|
||||
* 提现列表
|
||||
* Class WithdrawController
|
||||
* @package app\shopapi\controller
|
||||
*/
|
||||
class WithdrawController extends BaseShopController
|
||||
{
|
||||
|
||||
public function lists()
|
||||
{
|
||||
$lists = (new WithdrawLogic())->lists($this->shopId);
|
||||
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->shopId,$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->shopId,$post);
|
||||
if(true === $result){
|
||||
return $this->success('设置成功',[],1,1);
|
||||
}
|
||||
return $this->fail($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 提现
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/10/29 18:00
|
||||
*/
|
||||
public function apply(){
|
||||
$params = $this->request->post();
|
||||
$params['shop_id'] = $this->shopId;
|
||||
$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/29 17:21
|
||||
*/
|
||||
public function getWithdrawInfo()
|
||||
{
|
||||
$result = (new WithdrawLogic())->getWithdrawInfo($this->shopId);
|
||||
return $this->success('',$result,1,1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @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->shopId);
|
||||
return $this->success('',$result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user