底层添加路由
This commit is contained in:
10
Server/.env
10
Server/.env
@@ -4,11 +4,11 @@ trace = true
|
||||
|
||||
[database]
|
||||
type = mysql
|
||||
hostname = 103.144.2.26
|
||||
database = yi_54iis_com
|
||||
username = yi_54iis_com
|
||||
password = c1RbMwrZCCyxF1bC
|
||||
hostport = 3306
|
||||
hostname = 56b4c23f6853c.gz.cdb.myqcloud.com
|
||||
database = cunkebao_v3
|
||||
username = root
|
||||
password = Zhiqun1984
|
||||
hostport = 14413
|
||||
prefix = tk_
|
||||
|
||||
[api]
|
||||
|
||||
77
Server/application/api/config/route.php
Normal file
77
Server/application/api/config/route.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
// store模块路由配置
|
||||
|
||||
use think\facade\Route;
|
||||
|
||||
// 定义RESTful风格的API路由
|
||||
Route::group('v1', function () {
|
||||
Route::group('api', function () {
|
||||
// Account控制器路由
|
||||
Route::group('account', function () {
|
||||
Route::get('list', 'app\\api\\controller\\AccountController@getList'); // 获取账号列表 √
|
||||
Route::post('create', 'app\\api\\controller\\AccountController@createAccount'); // 创建账号 √
|
||||
Route::post('department/create', 'app\\api\\controller\\AccountController@createDepartment'); // 创建部门 √
|
||||
Route::get('department/list', 'app\\api\\controller\\AccountController@getDepartmentList'); // 获取部门列表 √
|
||||
});
|
||||
|
||||
// Device控制器路由
|
||||
Route::group('device', function () {
|
||||
Route::get('list', 'app\\api\\controller\\DeviceController@getList'); // 获取设备列表 √
|
||||
//Route::get('add/:accountId', 'app\\api\\controller\\DeviceController@addDevice'); // 生成设备二维码
|
||||
Route::post('add', 'app\\api\\controller\\DeviceController@addDevice'); // 生成设备二维码(POST方式) √
|
||||
});
|
||||
|
||||
// FriendTask控制器路由
|
||||
Route::group('friend-task', function () {
|
||||
Route::get('list', 'app\\api\\controller\\FriendTaskController@getList'); // 获取添加好友记录列表 √
|
||||
Route::post('add', 'app\\api\\controller\\FriendTaskController@addFriendTask'); // 添加好友任务 √
|
||||
});
|
||||
|
||||
// Moments控制器路由
|
||||
Route::group('moments', function () {
|
||||
Route::post('add-job', 'app\\api\\controller\\MomentsController@addJob'); // 发布朋友圈
|
||||
Route::get('list', 'app\\api\\controller\\MomentsController@getList'); // 获取朋友圈任务列表 √
|
||||
});
|
||||
|
||||
// Stats控制器路由
|
||||
Route::group('stats', function () {
|
||||
Route::get('basic-data', 'app\\api\\controller\\StatsController@basicData'); // 账号基本信息
|
||||
Route::get('fans-statistics', 'app\\api\\controller\\StatsController@FansStatistics'); // 好友统计
|
||||
});
|
||||
|
||||
// User控制器路由
|
||||
Route::group('user', function () {
|
||||
Route::post('login', 'app\\api\\controller\\UserController@login'); // 登录 √
|
||||
Route::post('token', 'app\\api\\controller\\UserController@getNewToken'); // 获取新的token √
|
||||
Route::get('info', 'app\\api\\controller\\UserController@getAccountInfo'); // 获取商户基本信息 √
|
||||
Route::post('modify-pwd', 'app\\api\\controller\\UserController@modifyPwd'); // 修改密码
|
||||
Route::get('logout', 'app\\api\\controller\\UserController@logout'); // 登出 √
|
||||
Route::get('verify-code', 'app\\api\\controller\\UserController@getVerifyCode'); // 获取验证码 √
|
||||
});
|
||||
|
||||
// WebSocket控制器路由
|
||||
Route::group('websocket', function () {
|
||||
Route::post('send-personal', 'app\\api\\controller\\WebSocketController@sendPersonal'); // 个人消息发送 √
|
||||
Route::post('send-community', 'app\\api\\controller\\WebSocketController@sendCommunity'); // 发送群消息 √
|
||||
Route::get('get-moments', 'app\\api\\controller\\WebSocketController@getMoments'); // 获取指定账号朋友圈信息 √
|
||||
Route::get('get-moment-source', 'app\\api\\controller\\WebSocketController@getMomentSourceRealUrl'); // 获取指定账号朋友圈图片地址
|
||||
});
|
||||
|
||||
// WechatChatroom控制器路由
|
||||
Route::group('chatroom', function () {
|
||||
Route::get('list', 'app\\api\\controller\\WechatChatroomController@getList'); // 获取微信群聊列表 √
|
||||
//Route::get('members/:wechatChatroomId', 'app\\api\\controller\\WechatChatroomController@listChatroomMember'); // 获取群成员列表 √
|
||||
// Route::get('sync', 'app\\api\\controller\\WechatChatroomController@syncChatrooms'); // 同步微信群聊数据 √
|
||||
});
|
||||
|
||||
// Wechat控制器路由
|
||||
Route::group('wechat', function () {
|
||||
Route::get('list', 'app\\api\\controller\\WechatController@getList'); // 获取微信账号列表 √
|
||||
});
|
||||
|
||||
// WechatFriend控制器路由
|
||||
Route::group('friend', function () {
|
||||
Route::get('list', 'app\\api\\controller\\WechatFriendController@getList'); // 获取微信好友列表数据 √
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\model\CompanyAccountModel;
|
||||
use app\api\model\CompanyModel;
|
||||
use think\facade\Request;
|
||||
|
||||
class AccountController extends BaseController
|
||||
@@ -186,6 +187,73 @@ class AccountController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门列表
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function getDepartmentList()
|
||||
{
|
||||
// 获取授权token
|
||||
$authorization = trim($this->request->header('authorization', ''));
|
||||
if (empty($authorization)) {
|
||||
return errorJson('缺少授权信息');
|
||||
}
|
||||
|
||||
try {
|
||||
// 设置请求参数
|
||||
$isAll = $this->request->param('isAll', 'false');
|
||||
|
||||
// 设置请求头
|
||||
$headerData = ['client:system'];
|
||||
$header = setHeader($headerData, $authorization, 'json');
|
||||
|
||||
// 发送请求获取部门列表
|
||||
$url = $this->baseUrl . 'api/Department/tenantDepartmentsForSelect?isAll=' . $isAll;
|
||||
$result = requestCurl($url, [], 'GET', $header, 'json');
|
||||
|
||||
// 处理返回结果
|
||||
$response = handleApiResponse($result);
|
||||
|
||||
|
||||
// 保存数据到数据库
|
||||
if (!empty($response)) {
|
||||
foreach ($response as $item) {
|
||||
$this->saveDepartment($item);
|
||||
}
|
||||
}
|
||||
|
||||
return successJson($response, '获取部门列表成功');
|
||||
} catch (\Exception $e) {
|
||||
return errorJson('获取部门列表失败:' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存部门数据到数据库
|
||||
* @param array $item 部门数据
|
||||
*/
|
||||
private function saveDepartment($item)
|
||||
{
|
||||
$data = [
|
||||
'id' => isset($item['id']) ? $item['id'] : 0,
|
||||
'name' => isset($item['name']) ? $item['name'] : '',
|
||||
'memo' => isset($item['memo']) ? $item['memo'] : '',
|
||||
];
|
||||
|
||||
// 使用imei作为唯一性判断
|
||||
$department= CompanyModel::where('id', $item['id'])->find();
|
||||
|
||||
if ($department) {
|
||||
$department->save($data);
|
||||
} else {
|
||||
CompanyModel::create($data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 保存账号数据到数据库
|
||||
* @param array $item 账号数据
|
||||
|
||||
@@ -150,18 +150,17 @@ class UserController extends BaseController
|
||||
}
|
||||
|
||||
$headerData = ['client:' . self::CLIENT_TYPE];
|
||||
$header = setHeader($headerData, $authorization, 'plain');
|
||||
$header = setHeader($headerData, $authorization, 'json');
|
||||
|
||||
try {
|
||||
$result = requestCurl($this->baseUrl . 'api/Account/self', [], 'GET', $header);
|
||||
$result = requestCurl($this->baseUrl . 'api/Account/self', [], 'GET', $header,'json');
|
||||
$response = handleApiResponse($result);
|
||||
|
||||
if (!empty($response['account'])) {
|
||||
$accountData = $response['account'];
|
||||
|
||||
// 准备数据库字段映射,保持驼峰命名
|
||||
$dbData = [
|
||||
'accountId' => $accountData['id'],
|
||||
'tenantId' => $accountData['id'],
|
||||
'realName' => $accountData['realName'],
|
||||
'nickname' => $accountData['nickname'],
|
||||
'memo' => $accountData['memo'],
|
||||
@@ -169,7 +168,7 @@ class UserController extends BaseController
|
||||
'userName' => $accountData['userName'],
|
||||
'secret' => $accountData['secret'],
|
||||
'accountType' => $accountData['accountType'],
|
||||
'departmentId' => $accountData['departmentId'],
|
||||
'companyId' => $accountData['departmentId'],
|
||||
'useGoogleSecretKey' => $accountData['useGoogleSecretKey'],
|
||||
'hasVerifyGoogleSecret' => $accountData['hasVerifyGoogleSecret'],
|
||||
'updateTime' => time()
|
||||
|
||||
@@ -6,5 +6,6 @@ use think\Model;
|
||||
|
||||
class CompanyAccountModel extends Model
|
||||
{
|
||||
|
||||
// 设置表名
|
||||
protected $name = 'company_account';
|
||||
}
|
||||
10
Server/application/api/model/CompanyModel.php
Normal file
10
Server/application/api/model/CompanyModel.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class CompanyModel extends Model {
|
||||
// 设置表名
|
||||
protected $name = 'company';
|
||||
}
|
||||
@@ -5,5 +5,6 @@ namespace app\api\model;
|
||||
use think\Model;
|
||||
|
||||
class DeviceModel extends Model {
|
||||
|
||||
// 设置表名
|
||||
protected $name = 'device';
|
||||
}
|
||||
@@ -6,5 +6,6 @@ use think\Model;
|
||||
|
||||
class FriendTaskModel extends Model
|
||||
{
|
||||
|
||||
// 设置表名
|
||||
protected $name = 'friend_task';
|
||||
}
|
||||
@@ -6,5 +6,6 @@ use think\Model;
|
||||
|
||||
class WechatAccountModel extends Model
|
||||
{
|
||||
|
||||
// 设置表名
|
||||
protected $name = 'wechat_account';
|
||||
}
|
||||
@@ -6,5 +6,6 @@ use think\Model;
|
||||
|
||||
class WechatChatroomMemberModel extends Model
|
||||
{
|
||||
|
||||
// 设置表名
|
||||
protected $name = 'wechat_chatroom_member';
|
||||
}
|
||||
@@ -6,5 +6,6 @@ use think\Model;
|
||||
|
||||
class WechatChatroomModel extends Model
|
||||
{
|
||||
|
||||
// 设置表名
|
||||
protected $name = 'wechat_chatroom';
|
||||
}
|
||||
@@ -6,5 +6,6 @@ use think\Model;
|
||||
|
||||
class WechatFriendModel extends Model
|
||||
{
|
||||
|
||||
// 设置表名
|
||||
protected $name = 'wechat_friend';
|
||||
}
|
||||
@@ -69,7 +69,7 @@ class Api extends Controller
|
||||
// 允许跨域
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
|
||||
header('Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With');
|
||||
header('Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With, X-Token, X-Api-Token');
|
||||
header('Access-Control-Max-Age: 1728000');
|
||||
header('Access-Control-Allow-Credentials: true');
|
||||
|
||||
|
||||
@@ -8,7 +8,14 @@ Route::group('v1/store', function () {
|
||||
// 流量套餐相关路由
|
||||
Route::group('flow-packages', function () {
|
||||
Route::get('', 'app\\store\\controller\\FlowPackageController@getList'); // 获取流量套餐列表
|
||||
Route::get(':id', 'app\\store\\controller\\FlowPackageController@detail'); // 获取流量套餐详情
|
||||
Route::get('remaining-flow', 'app\\store\\controller\\FlowPackageController@remainingFlow'); // 获取用户剩余流量
|
||||
Route::get(':id', 'app\\store\\controller\\FlowPackageController@detail'); // 获取流量套餐详情
|
||||
Route::post('order', 'app\\store\\controller\\FlowPackageController@createOrder'); // 创建流量采购订单
|
||||
});
|
||||
|
||||
// 流量订单相关路由
|
||||
Route::group('flow-orders', function () {
|
||||
Route::get('list', 'app\\store\\controller\\FlowPackageController@getOrderList'); // 获取订单列表
|
||||
Route::get(':orderNo', 'app\\store\\controller\\FlowPackageController@getOrderDetail'); // 获取订单详情
|
||||
});
|
||||
})/*->middleware(['jwt'])*/;
|
||||
@@ -5,6 +5,7 @@ namespace app\store\controller;
|
||||
use app\common\controller\Api;
|
||||
use app\store\model\FlowPackageModel;
|
||||
use app\store\model\UserFlowPackageModel;
|
||||
use app\store\model\FlowPackageOrderModel;
|
||||
use think\facade\Config;
|
||||
|
||||
/**
|
||||
@@ -108,7 +109,7 @@ class FlowPackageController extends Api
|
||||
$params = $this->request->param();
|
||||
|
||||
// 获取用户ID,通常应该从会话或令牌中获取
|
||||
$userId = isset($params['userId']) ? intval($params['userId']) : 0;
|
||||
$userId = isset($params['userId']) ? intval($params['userId']) : 1;
|
||||
|
||||
if (empty($userId)) {
|
||||
return errorJson('请先登录');
|
||||
@@ -161,4 +162,132 @@ class FlowPackageController extends Api
|
||||
|
||||
return successJson($result, '获取成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建流量采购订单
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function createOrder()
|
||||
{
|
||||
$params = $this->request->param();
|
||||
|
||||
// 获取用户ID,通常应该从会话或令牌中获取
|
||||
$userId = isset($params['userId']) ? intval($params['userId']) : 1;
|
||||
|
||||
if (empty($userId)) {
|
||||
return errorJson('请先登录');
|
||||
}
|
||||
|
||||
// 获取套餐ID
|
||||
$packageId = isset($params['packageId']) ? intval($params['packageId']) : 0;
|
||||
|
||||
if (empty($packageId)) {
|
||||
return errorJson('请选择套餐');
|
||||
}
|
||||
|
||||
// 查询套餐信息
|
||||
$flowPackage = FlowPackageModel::where('id', $packageId)->where('isDel', 0)->find();
|
||||
|
||||
if (empty($flowPackage)) {
|
||||
return errorJson('套餐不存在');
|
||||
}
|
||||
|
||||
// 获取支付方式(可选)
|
||||
$payType = isset($params['payType']) ? $params['payType'] : 'wechat';
|
||||
|
||||
// 套餐价格和信息
|
||||
$amount = floatval($flowPackage['price']);
|
||||
$packageName = $flowPackage['name'];
|
||||
$duration = intval($flowPackage['duration']);
|
||||
$remark = isset($params['remark']) ? $params['remark'] : '';
|
||||
|
||||
// 处理金额为0的特殊情况
|
||||
if ($amount <= 0) {
|
||||
// 金额为0,无需支付,直接创建订单并设置为已支付
|
||||
$order = FlowPackageOrderModel::createOrder(
|
||||
$userId,
|
||||
$packageId,
|
||||
$packageName,
|
||||
0,
|
||||
$duration,
|
||||
'nopay',
|
||||
$remark
|
||||
);
|
||||
|
||||
if (!$order) {
|
||||
return errorJson('订单创建失败');
|
||||
}
|
||||
|
||||
// 创建用户流量套餐记录
|
||||
$this->createUserFlowPackage($userId, $packageId, $order['id']);
|
||||
|
||||
// 返回成功信息
|
||||
return successJson(['orderNo' => $order['orderNo'],'status' => 'success'], '购买成功');
|
||||
} else {
|
||||
// 创建正常需要支付的订单
|
||||
$order = FlowPackageOrderModel::createOrder(
|
||||
$userId,
|
||||
$packageId,
|
||||
$packageName,
|
||||
$amount,
|
||||
$duration,
|
||||
$payType,
|
||||
$remark
|
||||
);
|
||||
|
||||
if (!$order) {
|
||||
return errorJson('订单创建失败');
|
||||
}
|
||||
|
||||
// 返回订单信息,前端需要跳转到支付页面
|
||||
return successJson([
|
||||
'orderNo' => $order['orderNo'],
|
||||
'amount' => $amount,
|
||||
'payType' => $payType,
|
||||
'status' => 'pending'
|
||||
], '订单创建成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建用户流量套餐记录
|
||||
*
|
||||
* @param int $userId 用户ID
|
||||
* @param int $packageId 套餐ID
|
||||
* @param int $orderId 订单ID
|
||||
* @return bool
|
||||
*/
|
||||
private function createUserFlowPackage($userId, $packageId, $orderId)
|
||||
{
|
||||
// 获取套餐信息
|
||||
$flowPackage = FlowPackageModel::where('id', $packageId)->where('isDel', 0)->find();
|
||||
|
||||
if (empty($flowPackage)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 计算到期时间(当前时间 + 套餐时长(月) * 30天)
|
||||
$now = time();
|
||||
$expireTime = $now + (intval($flowPackage['duration']) * 30 * 86400);
|
||||
|
||||
// 用户流量套餐数据
|
||||
$data = [
|
||||
'userId' => $userId,
|
||||
'packageId' => $packageId,
|
||||
'orderId' => $orderId,
|
||||
'packageName' => $flowPackage['name'],
|
||||
'monthlyFlow' => $flowPackage['monthlyFlow'],
|
||||
'duration' => $flowPackage['duration'],
|
||||
'totalFlow' => $flowPackage->totalFlow, // 使用计算属性获取总流量
|
||||
'usedFlow' => 0,
|
||||
'startTime' => $now,
|
||||
'expireTime' => $expireTime,
|
||||
'status' => 1, // 1:有效 0:无效
|
||||
'isDel' => 0
|
||||
];
|
||||
|
||||
// 创建用户流量套餐记录
|
||||
return UserFlowPackageModel::create($data) ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
93
Server/application/store/model/FlowPackageOrderModel.php
Normal file
93
Server/application/store/model/FlowPackageOrderModel.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
namespace app\store\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 流量订单模型
|
||||
*/
|
||||
class FlowPackageOrderModel extends Model
|
||||
{
|
||||
// 设置表名
|
||||
protected $name = 'flow_package_order';
|
||||
|
||||
// 自动写入时间戳
|
||||
protected $autoWriteTimestamp = true;
|
||||
protected $createTime = 'createTime';
|
||||
protected $updateTime = 'updateTime';
|
||||
|
||||
// 类型转换
|
||||
protected $type = [
|
||||
'id' => 'integer',
|
||||
'userId' => 'integer',
|
||||
'packageId' => 'integer',
|
||||
'amount' => 'float',
|
||||
'duration' => 'integer',
|
||||
'createTime' => 'timestamp',
|
||||
'updateTime' => 'timestamp',
|
||||
'payTime' => 'timestamp',
|
||||
'status' => 'integer',
|
||||
'payStatus' => 'integer',
|
||||
'isDel' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* 生成订单号
|
||||
* 规则:LL + 年月日时分秒 + 5位随机数
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function generateOrderNo()
|
||||
{
|
||||
$prefix = 'LL';
|
||||
$date = date('YmdHis');
|
||||
$random = mt_rand(10000, 99999);
|
||||
|
||||
return $prefix . $date . $random;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建订单
|
||||
*
|
||||
* @param int $userId 用户ID
|
||||
* @param int $packageId 套餐ID
|
||||
* @param string $packageName 套餐名称
|
||||
* @param float $amount 订单金额
|
||||
* @param int $duration 购买时长(月)
|
||||
* @param string $payType 支付类型 (wechat|alipay|nopay)
|
||||
* @param string $remark 备注
|
||||
* @return array|false
|
||||
*/
|
||||
public static function createOrder($userId, $packageId, $packageName, $amount, $duration, $payType = 'wechat', $remark = '')
|
||||
{
|
||||
// 生成订单号
|
||||
$orderNo = self::generateOrderNo();
|
||||
|
||||
// 订单数据
|
||||
$data = [
|
||||
'userId' => $userId,
|
||||
'packageId' => $packageId,
|
||||
'packageName' => $packageName,
|
||||
'orderNo' => $orderNo,
|
||||
'amount' => $amount,
|
||||
'duration' => $duration,
|
||||
'payType' => $payType,
|
||||
'createTime' => time(),
|
||||
'status' => 0, // 0:待支付 1:已完成 2:已取消 3:已退款
|
||||
'payStatus' => $payType == 'nopay' ? 10 : 0, // 0:未支付 1:已支付 10:无需支付
|
||||
'remark' => $remark,
|
||||
'isDel' => 0,
|
||||
];
|
||||
|
||||
// 创建订单
|
||||
$model = new self();
|
||||
$result = $model->save($data);
|
||||
|
||||
if ($result) {
|
||||
return $model->toArray();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Server/database/flow_order.sql
Normal file
24
Server/database/flow_order.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
-- 创建流量订单表
|
||||
CREATE TABLE IF NOT EXISTS `tk_flow_order` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`userId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
|
||||
`packageId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '套餐ID',
|
||||
`orderNo` varchar(32) NOT NULL DEFAULT '' COMMENT '订单号',
|
||||
`price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '支付价格',
|
||||
`originalPrice` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '原价',
|
||||
`payType` varchar(20) NOT NULL DEFAULT '' COMMENT '支付类型(wxpay|alipay|nopay)',
|
||||
`tradeNo` varchar(64) NOT NULL DEFAULT '' COMMENT '支付平台交易号',
|
||||
`createTime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`updateTime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
|
||||
`payTime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付时间',
|
||||
`status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0:待支付 1:已完成 2:已取消)',
|
||||
`payStatus` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付状态(0:未支付 10:已支付)',
|
||||
`memo` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
|
||||
`isDel` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除(0:否 1:是)',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_order_no` (`orderNo`),
|
||||
KEY `idx_user_id` (`userId`),
|
||||
KEY `idx_package_id` (`packageId`),
|
||||
KEY `idx_create_time` (`createTime`),
|
||||
KEY `idx_status` (`status`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='流量订单表';
|
||||
@@ -11,6 +11,9 @@
|
||||
|
||||
use think\facade\Route;
|
||||
|
||||
// 加载Store模块路由配置
|
||||
include __DIR__ . '/../application/api/config/route.php';
|
||||
|
||||
// 加载Common模块路由配置
|
||||
include __DIR__ . '/../application/common/config/route.php';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user