提交其他文件
This commit is contained in:
31
app/storeapi/controller/BaseApiController.php
Normal file
31
app/storeapi/controller/BaseApiController.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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\storeapi\controller;
|
||||
|
||||
use app\common\controller\BaseLikeAdminController;
|
||||
|
||||
class BaseApiController extends BaseLikeAdminController
|
||||
{
|
||||
protected int $userId = 0;
|
||||
protected array $userInfo = [];
|
||||
|
||||
public function initialize()
|
||||
{
|
||||
if (isset($this->request->userInfo) && $this->request->userInfo) {
|
||||
$this->userInfo = $this->request->userInfo;
|
||||
$this->userId = $this->request->userInfo['user_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
61
app/storeapi/controller/DeviceController.php
Normal file
61
app/storeapi/controller/DeviceController.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace app\storeapi\controller;
|
||||
|
||||
use app\storeapi\logic\DeviceLogic;
|
||||
use app\storeapi\validate\DeviceValidate;
|
||||
|
||||
class DeviceController extends BaseApiController
|
||||
{
|
||||
|
||||
public array $notNeedLogin = ['deviceOff_On'];
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* 门店设备列表
|
||||
*/
|
||||
public function deviceList(){
|
||||
|
||||
$params = (new DeviceValidate())->post()->goCheck('deviceList');
|
||||
|
||||
$result = DeviceLogic::getDeviceLists($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(DeviceLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* 空开控制
|
||||
*/
|
||||
public function deviceOff_On(){
|
||||
|
||||
$params = (new DeviceValidate())->post()->goCheck('deviceOff_On');
|
||||
|
||||
$result = DeviceLogic::deviceOff_On($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(DeviceLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* 门锁控制
|
||||
*/
|
||||
public function lockOff_On(){
|
||||
|
||||
$params = (new DeviceValidate())->post()->goCheck('lockOff_On');
|
||||
|
||||
$result = DeviceLogic::lockOff_On($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(DeviceLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
104
app/storeapi/controller/GroupController.php
Normal file
104
app/storeapi/controller/GroupController.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace app\storeapi\controller;
|
||||
|
||||
use app\storeapi\logic\GroupLogic;
|
||||
use app\storeapi\validate\GroupValidate;
|
||||
|
||||
|
||||
class GroupController extends BaseApiController
|
||||
{
|
||||
public array $notNeedLogin = ['cancelCode'];
|
||||
|
||||
/**
|
||||
* @return \think\response\Json
|
||||
* 新增团购套餐
|
||||
*/
|
||||
public function addGroup(){
|
||||
$params = (new GroupValidate())->post()->goCheck('addGroup');
|
||||
$result = GroupLogic::addGroup($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(GroupLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
|
||||
}
|
||||
/**
|
||||
* @return \think\response\Json
|
||||
* 编辑团购套餐
|
||||
*/
|
||||
public function editGroup(){
|
||||
$params = (new GroupValidate())->post()->goCheck('editGroup');
|
||||
$result = GroupLogic::editGroup($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(GroupLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @return \think\response\Json
|
||||
* 套餐列表
|
||||
*/
|
||||
public function groupLists(){
|
||||
$params = (new GroupValidate())->post()->goCheck('groupLists');
|
||||
$result = GroupLogic::groupLists($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(GroupLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @return \think\response\Json
|
||||
* 删除套餐
|
||||
*/
|
||||
public function delGroup(){
|
||||
$params = (new GroupValidate())->post()->goCheck('delGroup');
|
||||
$result = GroupLogic::delGroup($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(GroupLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @return \think\response\Json
|
||||
* 上下架套餐
|
||||
*/
|
||||
public function operateGroup(){
|
||||
$params = (new GroupValidate())->post()->goCheck('operateGroup');
|
||||
$result = GroupLogic::operateGroup($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(GroupLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \think\response\Json
|
||||
* 套餐详情页
|
||||
*/
|
||||
public function groupDetails(){
|
||||
$params = (new GroupValidate())->post()->goCheck('groupDetails');
|
||||
$result = GroupLogic::groupDetails($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(GroupLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \think\response\Json
|
||||
* 门店核销券码
|
||||
*/
|
||||
|
||||
public function cancelCode(){
|
||||
$params = (new GroupValidate())->post()->goCheck('cancelCode');
|
||||
$params['user_id'] = $this->userId;
|
||||
$result = GroupLogic::cancelCode($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(GroupLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
146
app/storeapi/controller/OrderController.php
Normal file
146
app/storeapi/controller/OrderController.php
Normal file
@ -0,0 +1,146 @@
|
||||
<?php
|
||||
|
||||
namespace app\storeapi\controller;
|
||||
|
||||
use app\storeapi\logic\DeviceLogic;
|
||||
use app\storeapi\logic\OrderLogic;
|
||||
|
||||
class OrderController extends BaseApiController
|
||||
{
|
||||
public array $notNeedLogin = [];
|
||||
|
||||
/**
|
||||
* @notes 包间订单列表
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/11/20 15:03
|
||||
* @data id
|
||||
*/
|
||||
public function orderStoreList(){
|
||||
$userId = $this->userId;
|
||||
$data = $this->request->post();
|
||||
$result = OrderLogic::orderStoreList($data,$userId);
|
||||
return $this->success('查询成功', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @notes 续单列表
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/11/25 18:03
|
||||
* @data id
|
||||
*/
|
||||
public function orderRenewList(){
|
||||
$data = $this->request->post();
|
||||
$result = OrderLogic::orderRenewList($data);
|
||||
return $this->success('查询成功', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @notes 茶室订单搜索历史
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/18 16:16
|
||||
*/
|
||||
public function orderStoreSearchHistory(){
|
||||
$userId = $this->userId;
|
||||
$result = OrderLogic::getOrderStoreSearchHistory($userId);
|
||||
return $this->success('查询成功', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @notes 一键清空茶室搜索历史
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/18 16:16
|
||||
*/
|
||||
public function delOrderStoreSearchHistory(){
|
||||
$userId = $this->userId;
|
||||
$result = OrderLogic::delOrderStoreSearchHistory($userId);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
/**
|
||||
* @notes 包间订单详情
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/18 16:16
|
||||
* @data
|
||||
*/
|
||||
public function orderStoreDetails(){
|
||||
$data = $this->request->post();
|
||||
$result = OrderLogic::orderStoreDetails($data);
|
||||
if($result){
|
||||
$d['details'] = $result;
|
||||
return $this->success('查询成功', $d, 1, 1);
|
||||
}
|
||||
return $this->fail(OrderLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 取消包间订单
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/11/20 15:38
|
||||
* @data
|
||||
*/
|
||||
public function cancelOrderStore(){
|
||||
$data = $this->request->post();
|
||||
$result = OrderLogic::cancelOrderStore($data);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除包间订单
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/11/20 15:38
|
||||
* @data
|
||||
*/
|
||||
public function delOrderStore(){
|
||||
$data = $this->request->post();
|
||||
// $result = OrderLogic::delOrderStore($data);
|
||||
return $this->success('目前删除', [], 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 释放包间订单
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/11/20 15:38
|
||||
* @data
|
||||
*/
|
||||
public function releaseOrderStore(){
|
||||
$data = $this->request->post();
|
||||
$result = OrderLogic::releaseOrderStore($data);
|
||||
if ($result === false) {
|
||||
return $this->fail(OrderLogic::getError());
|
||||
}
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
/**
|
||||
* 管理员预定
|
||||
*/
|
||||
|
||||
public function addOrder(){
|
||||
$userId = $this->userId;
|
||||
$data = $this->request->post();
|
||||
$result = OrderLogic::addOrder($data,$userId);
|
||||
if ($result === false) {
|
||||
return $this->fail(OrderLogic::getError());
|
||||
}
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员续订
|
||||
*/
|
||||
|
||||
public function renewOrder(){
|
||||
$userId = $this->userId;
|
||||
$data = $this->request->post();
|
||||
$result = OrderLogic::renewOrder($data,$userId);
|
||||
if ($result === false) {
|
||||
return $this->fail(OrderLogic::getError());
|
||||
}
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
49
app/storeapi/controller/SmsController.php
Normal file
49
app/storeapi/controller/SmsController.php
Normal 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\storeapi\controller;
|
||||
|
||||
|
||||
use app\api\logic\SmsLogic;
|
||||
use app\api\validate\SendSmsValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 短信
|
||||
* Class SmsController
|
||||
* @package app\api\controller
|
||||
*/
|
||||
class SmsController extends BaseApiController
|
||||
{
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
341
app/storeapi/controller/StoreController.php
Normal file
341
app/storeapi/controller/StoreController.php
Normal file
@ -0,0 +1,341 @@
|
||||
<?php
|
||||
|
||||
namespace app\storeapi\controller;
|
||||
use app\storeapi\logic\StoreLogic;
|
||||
class StoreController extends BaseApiController
|
||||
{
|
||||
public array $notNeedLogin = [];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取归属人门店列表
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/16 14:54
|
||||
*/
|
||||
public function userStoreList(){
|
||||
$userId = $this->userId;
|
||||
$result = StoreLogic::getUserStoreList($userId);
|
||||
return $this->success('查询成功', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 门店详情数据
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/16 14:54
|
||||
*/
|
||||
public function userStoreDetails(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::getUserStoreDetails($data);
|
||||
return $this->success('查询成功', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @notes 切换店铺
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/16 14:54
|
||||
*/
|
||||
public function switchStore(){
|
||||
$data = $this->request->post();
|
||||
$userId = $this->userId;
|
||||
$result = StoreLogic::switchStore($data,$userId);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑门店
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 16:15
|
||||
*/
|
||||
public function editStore()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::editStore($data);
|
||||
if($result){
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 包间列表
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 17:21
|
||||
*/
|
||||
public function roomList()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::roomList($data);
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @notes 包间选择列表
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 17:21
|
||||
*/
|
||||
public function roomSelectList()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::roomSelectList($data);
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @notes 包间状态
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 17:37
|
||||
*/
|
||||
public function editRoom()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::editRoom($data);
|
||||
if($result){
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
/**
|
||||
* @notes 茶室详情页
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/11/11 10:53
|
||||
*/
|
||||
public function roomDetails(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::roomDetails($data);
|
||||
return $this->success('查询成功', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @notes 获取加盟店套餐
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2026/2/3 16:30
|
||||
*/
|
||||
public function storeOperationGroup(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::storeOperationGroup($data);
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @notes 加盟店套餐详情
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2026/2/3 16:30
|
||||
*/
|
||||
public function storeOperationGroupDetails(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::storeOperationGroupDetails($data);
|
||||
if($result){
|
||||
$d['details'] = $result;
|
||||
return $this->success('查询成功', $d, 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
/**
|
||||
* @notes 包间标签列表
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/18 11:11
|
||||
*/
|
||||
public function roomLabelList()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::roomLabelList($data);
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加标签
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/18 11:13
|
||||
*/
|
||||
public function addLabel()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::addLabel($data);
|
||||
if($result){
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除标签
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/18 12:18
|
||||
*/
|
||||
public function delLabel()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::delLabel($data);
|
||||
if($result){
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 预定包间订单信息
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/18 14:15
|
||||
* @data
|
||||
*/
|
||||
public function submitStoreOrder(){
|
||||
$data = $this->request->post();
|
||||
$userId = $this->userId;
|
||||
$result = StoreLogic::addStoreOrder($data,$userId);
|
||||
if($result){
|
||||
$d['id'] = $result;
|
||||
return $this->success('操作成功', $d, 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
/**
|
||||
* @notes 续订
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/18 14:36
|
||||
* @data
|
||||
*/
|
||||
public function renewDtime(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::renewDtime($data);
|
||||
if($result){
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 充值套餐列表
|
||||
* @return \think\response\Json
|
||||
* @author Yzt
|
||||
* @date 2026/01/09 14:36
|
||||
* @data
|
||||
*/
|
||||
public function rechargeLists(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::rechargeLists($data);
|
||||
if($result){
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加充值套餐
|
||||
* @return \think\response\Json
|
||||
* @author Yzt
|
||||
* @date 2026/01/09 14:36
|
||||
* @data
|
||||
*/
|
||||
public function addRecharge(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::addRecharge($data);
|
||||
if($result){
|
||||
return $this->success('成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑充值套餐
|
||||
* @return \think\response\Json
|
||||
* @author Yzt
|
||||
* @date 2026/01/09 14:36
|
||||
* @data
|
||||
*/
|
||||
public function editRecharge(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::editRecharge($data);
|
||||
if($result){
|
||||
return $this->success('成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除充值套餐
|
||||
* @return \think\response\Json
|
||||
* @author Yzt
|
||||
* @date 2026/01/09 14:36
|
||||
* @data
|
||||
*/
|
||||
public function delRecharge(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::delRecharge($data);
|
||||
if($result){
|
||||
return $this->success('成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 开关充值套餐状态
|
||||
* @return \think\response\Json
|
||||
* @author Yzt
|
||||
* @date 2026/01/09 14:36
|
||||
* @data
|
||||
*/
|
||||
public function operateRecharge(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::operateRecharge($data);
|
||||
if($result){
|
||||
return $this->success('成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 资质上传
|
||||
* @return \think\response\Json
|
||||
* @author Yzt
|
||||
* @date 2026/02/11 14:46
|
||||
* @data
|
||||
*/
|
||||
public function addQual(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::addQual($data);
|
||||
if($result){
|
||||
return $this->success('提交成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
/**
|
||||
* @notes 资质详情
|
||||
* @return \think\response\Json
|
||||
* @author Yzt
|
||||
* @date 2026/02/11 15:03
|
||||
* @data
|
||||
*/
|
||||
public function qualDetails(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::qualDetails($data);
|
||||
$d['details'] = $result;
|
||||
return $this->success('', $d, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑资质
|
||||
* @return \think\response\Json
|
||||
* @author Yzt
|
||||
* @date 2026/02/11 21:41
|
||||
* @data
|
||||
*/
|
||||
public function editQual(){
|
||||
$data = $this->request->post();
|
||||
$result = StoreLogic::editQual($data);
|
||||
if($result){
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreLogic::getError());
|
||||
}
|
||||
}
|
||||
132
app/storeapi/controller/StoreLoginController.php
Normal file
132
app/storeapi/controller/StoreLoginController.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?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\storeapi\controller;
|
||||
|
||||
use app\common\cache\StoreUserTokenCache;
|
||||
use app\common\model\store\StoreUserSession;
|
||||
use app\storeapi\logic\StoreUserLogic;
|
||||
use app\storeapi\validate\{LoginAccountValidate, PasswordValidate, WechatLoginValidate};
|
||||
use app\storeapi\logic\StoreLoginLogic;
|
||||
|
||||
/**
|
||||
* 登录注册
|
||||
* Class LoginController
|
||||
* @package app\api\controller
|
||||
*/
|
||||
class StoreLoginController extends BaseApiController
|
||||
{
|
||||
|
||||
public array $notNeedLogin = [ 'account', 'logout', 'codeUrl','resetPassword'];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @notes 账号密码/手机号密码/手机号验证码登录
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/16 10:42
|
||||
*/
|
||||
public function account()
|
||||
{
|
||||
// $userTokenCache = new StoreUserTokenCache();
|
||||
// $userSession = StoreUserSession::where([['user_id', '=', 1], ['terminal', '=', 1]])->find();
|
||||
// $userTokenCache->deleteUserInfo($userSession->token);
|
||||
$params = (new LoginAccountValidate())->post()->goCheck();
|
||||
$result = StoreLoginLogic::login($params);
|
||||
if (false === $result) {
|
||||
return $this->fail(StoreLoginLogic::getError());
|
||||
}
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 重置密码
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/16 14:30
|
||||
*/
|
||||
public function resetPassword()
|
||||
{
|
||||
$params = (new PasswordValidate())->post()->goCheck('resetPassword');
|
||||
$result = StoreUserLogic::resetPassword($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(StoreUserLogic::getError());
|
||||
}
|
||||
/**
|
||||
* @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()
|
||||
{
|
||||
StoreLoginLogic::logout($this->userInfo);
|
||||
return $this->success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取微信请求code的链接
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/15 18:27
|
||||
*/
|
||||
public function codeUrl()
|
||||
{
|
||||
$url = $this->request->get('url');
|
||||
$result = ['url' => LoginLogic::codeUrl($url)];
|
||||
return $this->success('获取成功', $result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @notes 小程序绑定微信
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/20 19:48
|
||||
*/
|
||||
public function mnpAuthBind()
|
||||
{
|
||||
$params = (new WechatLoginValidate())->post()->goCheck("wechatAuth");
|
||||
$params['user_id'] = $this->userId;
|
||||
$result = LoginLogic::mnpAuthLogin($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(LoginLogic::getError());
|
||||
}
|
||||
return $this->success('绑定成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 更新用户头像昵称
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/22 11:15
|
||||
*/
|
||||
public function updateUser()
|
||||
{
|
||||
$params = (new WechatLoginValidate())->post()->goCheck("updateUser");
|
||||
LoginLogic::updateUser($params, $this->userId);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
30
app/storeapi/controller/TrainingController.php
Normal file
30
app/storeapi/controller/TrainingController.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace app\storeapi\controller;
|
||||
use app\storeapi\logic\TrainingLogic;
|
||||
class TrainingController extends BaseApiController
|
||||
{
|
||||
/**
|
||||
* @notes 获门店培训列表
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2026/2/12 1:02
|
||||
*/
|
||||
public function trainingList(){
|
||||
$data = $this->request->post();
|
||||
$result = TrainingLogic::trainingList($data);
|
||||
return $this->success('查询成功', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获门店培训详情
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2026/2/12 1:34
|
||||
*/
|
||||
public function trainingDetails(){
|
||||
$data = $this->request->post();
|
||||
$result = TrainingLogic::trainingDetails($data);
|
||||
return $this->success('查询成功', $result, 1, 1);
|
||||
}
|
||||
}
|
||||
63
app/storeapi/controller/UploadController.php
Normal file
63
app/storeapi/controller/UploadController.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?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\storeapi\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 BaseApiController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 上传图片
|
||||
* @return Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 16:34
|
||||
*/
|
||||
public function image()
|
||||
{
|
||||
try {
|
||||
$result = UploadService::image(0, $this->userId,FileEnum::SOURCE_USER);
|
||||
return $this->success('上传成功', $result);
|
||||
} catch (Exception $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 上传视频
|
||||
* @return Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 16:34
|
||||
*/
|
||||
public function video()
|
||||
{
|
||||
try {
|
||||
$cid = $this->request->post('cid', 0);
|
||||
$result = UploadService::video($cid);
|
||||
return $this->success('上传成功', $result);
|
||||
} catch (Exception $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
244
app/storeapi/controller/UserController.php
Normal file
244
app/storeapi/controller/UserController.php
Normal file
@ -0,0 +1,244 @@
|
||||
<?php
|
||||
|
||||
namespace app\storeapi\controller;
|
||||
|
||||
use app\storeapi\logic\UserLogic;
|
||||
|
||||
class UserController extends BaseApiController
|
||||
{
|
||||
public array $notNeedLogin = [];
|
||||
/**
|
||||
* @notes 获取个人信息
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/9/20 19:46
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
$result = UserLogic::info($this->userId);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @notes 更新用户头像昵称
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2023/2/22 11:15
|
||||
*/
|
||||
public function updateUser()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::updateUser($data, $this->userId);
|
||||
if($result){
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(UserLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 钱包明细
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 10:50
|
||||
*/
|
||||
public function balanceLogList()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::balanceLogList($data, $this->userId);
|
||||
if($result){
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
return $this->fail(UserLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 钱包明细详情
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 15:44
|
||||
*/
|
||||
public function balanceLogDetails()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::balanceLogDetails($data);
|
||||
if($result){
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
return $this->fail(UserLogic::getError());
|
||||
}
|
||||
/**
|
||||
* @notes 查询余额
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 14:28
|
||||
*/
|
||||
public function checkMoney()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::checkMoney($data);
|
||||
if($result){
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
return $this->fail(UserLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加到账方式
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 14:28
|
||||
*/
|
||||
public function addBank()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::addBank($data,$this->userId);
|
||||
if($result){
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(UserLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 查询到账方式
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 14:58
|
||||
*/
|
||||
public function checkBank()
|
||||
{
|
||||
$result = UserLogic::checkBank($this->userId);
|
||||
if($result){
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
return $this->fail(UserLogic::getError());
|
||||
}
|
||||
/**
|
||||
* @notes 删除到账方式
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 16:15
|
||||
*/
|
||||
public function delBank()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::delBank($data);
|
||||
if($result){
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(UserLogic::getError());
|
||||
}
|
||||
/**
|
||||
* @notes 提交体现
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/17 15:07
|
||||
*/
|
||||
public function submitReflect()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::submitReflect($data,$this->userId);
|
||||
if($result){
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(UserLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 查询门店用户
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/18 17:33
|
||||
*/
|
||||
public function checkStoreUserList()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::checkStoreUserList($data);
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 管理端余额充值明细
|
||||
* @return \think\response\Json
|
||||
* @author yzt
|
||||
* @date 2025/12/18 17:33
|
||||
*/
|
||||
public function storeRechargeLists()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::storeRechargeLists($data);
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 查询门店用户详情
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/19 13:52
|
||||
*/
|
||||
public function checkStoreUserDetails()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::checkStoreUserDetails($data);
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑门店用户备注
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/19 13:53
|
||||
*/
|
||||
public function editStoreUserRemark()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::editStoreUserRemark($data);
|
||||
if($result){
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(UserLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 查询门店用户消费明细
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/19 14:00
|
||||
*/
|
||||
public function checkStoreUserBuyList()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::checkStoreUserBuyList($data);
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 查询门店财务管理流水列表
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/19 14:48
|
||||
*/
|
||||
public function checkStoreAccountList()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::checkStoreAccountList($data,$this->userId);
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 首页统计
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/12/19 14:48
|
||||
*/
|
||||
public function checkMoth()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$result = UserLogic::checkMoth($data,$this->userId);
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user