mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改注释
This commit is contained in:
parent
b9ffff7114
commit
ab8ee66ff4
@ -58,6 +58,6 @@ class Goods extends Controller
|
|||||||
*/
|
*/
|
||||||
public function getRegion()
|
public function getRegion()
|
||||||
{
|
{
|
||||||
$this->success('获取区域成功', ExpressService::instance()->region(3, 1));
|
$this->success('获取区域成功', ExpressService::region(3, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -50,8 +50,8 @@ class Login extends Controller
|
|||||||
'password.require' => '登录密码不能为空!',
|
'password.require' => '登录密码不能为空!',
|
||||||
]);
|
]);
|
||||||
$map = ['deleted' => 0, 'phone' => $data['phone']];
|
$map = ['deleted' => 0, 'phone' => $data['phone']];
|
||||||
$user = DataUser::mk()->where($map)->find();
|
$user = DataUser::mk()->where($map)->findOrEmpty();
|
||||||
if (empty($user)) $this->error('该手机号还没有注册哦!');
|
if ($user->isEmpty()) $this->error('该手机号还没有注册哦!');
|
||||||
if (empty($user['status'])) $this->error('该用户账号状态异常!');
|
if (empty($user['status'])) $this->error('该用户账号状态异常!');
|
||||||
if (md5($data['password']) === $user['password']) {
|
if (md5($data['password']) === $user['password']) {
|
||||||
$this->success('手机登录成功!', UserAdminService::set($map, [], $this->type, true));
|
$this->success('手机登录成功!', UserAdminService::set($map, [], $this->type, true));
|
||||||
|
@ -65,5 +65,4 @@ class News extends Controller
|
|||||||
NewsService::instance()->buildListByUidAndCode($result['list']);
|
NewsService::instance()->buildListByUidAndCode($result['list']);
|
||||||
$this->success('获取评论成功', $result);
|
$this->success('获取评论成功', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -19,11 +19,7 @@ class Notify extends Controller
|
|||||||
* @param string $scene 支付场景
|
* @param string $scene 支付场景
|
||||||
* @param string $param 支付参数
|
* @param string $param 支付参数
|
||||||
* @return string
|
* @return string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
|
||||||
* @throws \think\admin\Exception
|
* @throws \think\admin\Exception
|
||||||
* @throws \think\db\exception\DataNotFoundException
|
|
||||||
* @throws \think\db\exception\DbException
|
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
|
||||||
*/
|
*/
|
||||||
public function wxpay(string $scene = 'order', string $param = ''): string
|
public function wxpay(string $scene = 'order', string $param = ''): string
|
||||||
{
|
{
|
||||||
@ -39,11 +35,7 @@ class Notify extends Controller
|
|||||||
* @param string $scene 支付场景
|
* @param string $scene 支付场景
|
||||||
* @param string $param 支付参数
|
* @param string $param 支付参数
|
||||||
* @return string
|
* @return string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
|
||||||
* @throws \think\admin\Exception
|
* @throws \think\admin\Exception
|
||||||
* @throws \think\db\exception\DataNotFoundException
|
|
||||||
* @throws \think\db\exception\DbException
|
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
|
||||||
*/
|
*/
|
||||||
public function alipay(string $scene = 'order', string $param = ''): string
|
public function alipay(string $scene = 'order', string $param = ''): string
|
||||||
{
|
{
|
||||||
@ -59,11 +51,7 @@ class Notify extends Controller
|
|||||||
* @param string $scene 支付场景
|
* @param string $scene 支付场景
|
||||||
* @param string $param 支付参数
|
* @param string $param 支付参数
|
||||||
* @return string
|
* @return string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
|
||||||
* @throws \think\admin\Exception
|
* @throws \think\admin\Exception
|
||||||
* @throws \think\db\exception\DataNotFoundException
|
|
||||||
* @throws \think\db\exception\DbException
|
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
|
||||||
*/
|
*/
|
||||||
public function joinpay(string $scene = 'order', string $param = ''): string
|
public function joinpay(string $scene = 'order', string $param = ''): string
|
||||||
{
|
{
|
||||||
|
@ -4,6 +4,7 @@ namespace app\data\controller\api\auth;
|
|||||||
|
|
||||||
use app\data\controller\api\Auth;
|
use app\data\controller\api\Auth;
|
||||||
use app\data\model\DataUserBalance;
|
use app\data\model\DataUserBalance;
|
||||||
|
use think\admin\helper\QueryHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户余额转账
|
* 用户余额转账
|
||||||
@ -14,14 +15,13 @@ class Balance extends Auth
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 获取用户余额记录
|
* 获取用户余额记录
|
||||||
* @throws \think\db\exception\DataNotFoundException
|
|
||||||
* @throws \think\db\exception\DbException
|
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
|
||||||
*/
|
*/
|
||||||
public function get()
|
public function get()
|
||||||
{
|
{
|
||||||
$query = DataUserBalance::mQuery()->withoutField('deleted,create_by');
|
DataUserBalance::mQuery(null, function (QueryHelper $query) {
|
||||||
|
$query->withoutField('deleted,create_by');
|
||||||
$query->where(['uuid' => $this->uuid, 'deleted' => 0])->like('create_at#date');
|
$query->where(['uuid' => $this->uuid, 'deleted' => 0])->like('create_at#date');
|
||||||
$this->success('获取数据成功', $query->order('id desc')->page(true, false, false, 10));
|
$this->success('获取数据成功', $query->order('id desc')->page(true, false, false, 10));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -118,8 +118,7 @@ class Center extends Auth
|
|||||||
$map[] = ['deleted', '=', 0];
|
$map[] = ['deleted', '=', 0];
|
||||||
$map[] = ['path', 'like', "%-{$this->uuid}-%"];
|
$map[] = ['path', 'like', "%-{$this->uuid}-%"];
|
||||||
// 查询邀请的朋友
|
// 查询邀请的朋友
|
||||||
$query = DataUser::mQuery();
|
$query = DataUser::mQuery()->like('nickname|username#nickname')->equal('vip_code,pids,pid1,id#uuid');
|
||||||
$query->like('nickname|username#nickname')->equal('vip_code,pids,pid1,id#uuid');
|
|
||||||
$query->field('id,pid0,pid1,pid2,pids,username,nickname,headimg,order_amount_total,teams_amount_total,teams_amount_direct,teams_amount_indirect,teams_users_total,teams_users_direct,teams_users_indirect,rebate_total,rebate_used,rebate_lock,create_at');
|
$query->field('id,pid0,pid1,pid2,pids,username,nickname,headimg,order_amount_total,teams_amount_total,teams_amount_direct,teams_amount_indirect,teams_users_total,teams_users_direct,teams_users_indirect,rebate_total,rebate_used,rebate_lock,create_at');
|
||||||
$result = $query->where($map)->order('id desc')->page(true, false, false, 15);
|
$result = $query->where($map)->order('id desc')->page(true, false, false, 15);
|
||||||
// 统计当前用户所有下属数
|
// 统计当前用户所有下属数
|
||||||
@ -143,9 +142,9 @@ class Center extends Auth
|
|||||||
$data = $this->_vali(['from.require' => '邀请人不能为空']);
|
$data = $this->_vali(['from.require' => '邀请人不能为空']);
|
||||||
[$state, $message] = UserUpgradeService::instance()->bindAgent($this->uuid, $data['from'], 0);
|
[$state, $message] = UserUpgradeService::instance()->bindAgent($this->uuid, $data['from'], 0);
|
||||||
if ($state) {
|
if ($state) {
|
||||||
$this->success($message, UserAdminService::instance()->total($this->uuid));
|
$this->success($message, UserAdminService::total($this->uuid));
|
||||||
} else {
|
} else {
|
||||||
$this->error($message, UserAdminService::instance()->total($this->uuid));
|
$this->error($message, UserAdminService::total($this->uuid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -403,7 +403,7 @@ class Order extends Auth
|
|||||||
{
|
{
|
||||||
[$map, $order] = $this->getOrderData();
|
[$map, $order] = $this->getOrderData();
|
||||||
if (empty($order)) $this->error('读取订单失败');
|
if (empty($order)) $this->error('读取订单失败');
|
||||||
if (in_array($order['status'], [0])) {
|
if ($order['status'] == 0) {
|
||||||
$result = ShopOrder::mk()->where($map)->update([
|
$result = ShopOrder::mk()->where($map)->update([
|
||||||
'status' => 0,
|
'status' => 0,
|
||||||
'deleted_status' => 1,
|
'deleted_status' => 1,
|
||||||
@ -430,7 +430,7 @@ class Order extends Auth
|
|||||||
public function confirm()
|
public function confirm()
|
||||||
{
|
{
|
||||||
[$map, $order] = $this->getOrderData();
|
[$map, $order] = $this->getOrderData();
|
||||||
if (in_array($order['status'], [5])) {
|
if ($order['status'] == 5) {
|
||||||
if (ShopOrder::mk()->where($map)->update(['status' => 6]) !== false) {
|
if (ShopOrder::mk()->where($map)->update(['status' => 6]) !== false) {
|
||||||
// 触发订单确认事件
|
// 触发订单确认事件
|
||||||
$this->app->event->trigger('ShopOrderConfirm', $order['order_no']);
|
$this->app->event->trigger('ShopOrderConfirm', $order['order_no']);
|
||||||
@ -481,8 +481,11 @@ class Order extends Auth
|
|||||||
public function track()
|
public function track()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$data = $this->_vali(['code.require' => '快递不能为空', 'number.require' => '单号不能为空']);
|
$data = $this->_vali([
|
||||||
$result = ExpressService::instance()->query($data['code'], $data['number']);
|
'code.require' => '快递不能为空',
|
||||||
|
'number.require' => '单号不能为空'
|
||||||
|
]);
|
||||||
|
$result = ExpressService::query($data['code'], $data['number']);
|
||||||
empty($result['code']) ? $this->error($result['info']) : $this->success('快递追踪信息', $result);
|
empty($result['code']) ? $this->error($result['info']) : $this->success('快递追踪信息', $result);
|
||||||
} catch (HttpResponseException $exception) {
|
} catch (HttpResponseException $exception) {
|
||||||
throw $exception;
|
throw $exception;
|
||||||
|
@ -57,7 +57,7 @@ class Transfer extends Auth
|
|||||||
[$total, $count] = UserRebateService::instance()->amount($this->uuid);
|
[$total, $count] = UserRebateService::instance()->amount($this->uuid);
|
||||||
if ($total - $count < $data['amount']) $this->error('可提现余额不足!');
|
if ($total - $count < $data['amount']) $this->error('可提现余额不足!');
|
||||||
// 提现方式处理
|
// 提现方式处理
|
||||||
if (in_array($data['type'], ['alipay_account'])) {
|
if ($data['type'] == 'alipay_account') {
|
||||||
$data = array_merge($data, $this->_vali([
|
$data = array_merge($data, $this->_vali([
|
||||||
'alipay_user.require' => '开户姓名不能为空!',
|
'alipay_user.require' => '开户姓名不能为空!',
|
||||||
'alipay_code.require' => '支付账号不能为空!',
|
'alipay_code.require' => '支付账号不能为空!',
|
||||||
@ -74,7 +74,7 @@ class Transfer extends Auth
|
|||||||
'bank_bran.require' => '银行分行不能为空!',
|
'bank_bran.require' => '银行分行不能为空!',
|
||||||
'bank_code.require' => '银行卡号不能为空!',
|
'bank_code.require' => '银行卡号不能为空!',
|
||||||
]));
|
]));
|
||||||
} elseif (!in_array($data['type'], ['wechat_wallet'])) {
|
} elseif ($data['type'] != 'wechat_wallet') {
|
||||||
$this->error('转账方式不存在!');
|
$this->error('转账方式不存在!');
|
||||||
}
|
}
|
||||||
// 当日提现次数限制
|
// 当日提现次数限制
|
||||||
@ -130,7 +130,7 @@ class Transfer extends Auth
|
|||||||
DataUserTransfer::mk()->where($data)->whereIn('status', [1, 2, 3])->update([
|
DataUserTransfer::mk()->where($data)->whereIn('status', [1, 2, 3])->update([
|
||||||
'status' => 0, 'change_time' => date("Y-m-d H:i:s"), 'change_desc' => '用户主动取消提现',
|
'status' => 0, 'change_time' => date("Y-m-d H:i:s"), 'change_desc' => '用户主动取消提现',
|
||||||
]);
|
]);
|
||||||
UserRebateService::instance()->amount($this->uuid);
|
UserRebateService::amount($this->uuid);
|
||||||
$this->success('取消提现成功');
|
$this->success('取消提现成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ class Transfer extends Auth
|
|||||||
DataUserTransfer::mk()->where($data)->whereIn('status', [4])->update([
|
DataUserTransfer::mk()->where($data)->whereIn('status', [4])->update([
|
||||||
'status' => 5, 'change_time' => date("Y-m-d H:i:s"), 'change_desc' => '用户主动确认收款',
|
'status' => 5, 'change_time' => date("Y-m-d H:i:s"), 'change_desc' => '用户主动确认收款',
|
||||||
]);
|
]);
|
||||||
UserRebateService::instance()->amount($this->uuid);
|
UserRebateService::amount($this->uuid);
|
||||||
$this->success('确认收款成功');
|
$this->success('确认收款成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ class Transfer extends Auth
|
|||||||
*/
|
*/
|
||||||
public function config()
|
public function config()
|
||||||
{
|
{
|
||||||
$data = UserTransferService::instance()->config();
|
$data = UserTransferService::config();
|
||||||
$data['banks'] = UserTransferService::instance()->banks();
|
$data['banks'] = UserTransferService::instance()->banks();
|
||||||
$this->success('获取用户提现配置', $data);
|
$this->success('获取用户提现配置', $data);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ class UserTransferService extends Service
|
|||||||
* @throws \think\db\exception\DbException
|
* @throws \think\db\exception\DbException
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
*/
|
*/
|
||||||
public function config(?string $name = null)
|
public static function config(?string $name = null)
|
||||||
{
|
{
|
||||||
static $data = [];
|
static $data = [];
|
||||||
if (empty($data)) $data = sysdata('TransferRule');
|
if (empty($data)) $data = sysdata('TransferRule');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user