mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update UserRebateService.php
This commit is contained in:
parent
c90c65afd2
commit
4db65f5203
@ -20,7 +20,7 @@ class UserRebateService extends Service
|
|||||||
* @param integer $uuid
|
* @param integer $uuid
|
||||||
* @return array [total, count, lock]
|
* @return array [total, count, lock]
|
||||||
*/
|
*/
|
||||||
public function amount(int $uuid): array
|
public static function amount(int $uuid): array
|
||||||
{
|
{
|
||||||
if ($uuid > 0) {
|
if ($uuid > 0) {
|
||||||
$count = DataUserTransfer::mk()->whereRaw("uuid='{$uuid}' and status>0")->sum('amount');
|
$count = DataUserTransfer::mk()->whereRaw("uuid='{$uuid}' and status>0")->sum('amount');
|
||||||
@ -43,10 +43,10 @@ class UserRebateService extends Service
|
|||||||
* @throws \think\db\exception\DbException
|
* @throws \think\db\exception\DbException
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
*/
|
*/
|
||||||
public function confirm(string $orderNo): array
|
public static function confirm(string $orderNo): array
|
||||||
{
|
{
|
||||||
$map = [['status', '>=', 4], ['order_no', '=', $orderNo]];
|
$map = [['status', '>=', 4], ['order_no', '=', $orderNo]];
|
||||||
$order = ShopOrder::mk()->where($map)->find();
|
$order = ShopOrder::mk()->where($map)->findOrEmpty()->toArray();
|
||||||
if (empty($order)) return [0, '需处理的订单状态异常!'];
|
if (empty($order)) return [0, '需处理的订单状态异常!'];
|
||||||
$map = [['status', '=', 0], ['order_no', 'like', "{$orderNo}%"]];
|
$map = [['status', '=', 0], ['order_no', 'like', "{$orderNo}%"]];
|
||||||
DataUserRebate::mk()->where($map)->update(['status' => 1]);
|
DataUserRebate::mk()->where($map)->update(['status' => 1]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user