获取未读数量的已完成返补订单

This commit is contained in:
wangxiaowei 2024-08-07 19:48:24 +08:00
parent 7ff1cc41f1
commit e7a5a92346
2 changed files with 9 additions and 3 deletions

@ -8,18 +8,18 @@ use app\api\logic\BillionsLogic;
use app\common\server\JsonServer;
use app\common\server\WeChatServer;
use EasyWeChat\Factory;
use app\common\enum\WithdrawEnum;
use app\common\model\WithdrawApply;
use think\facade\Db;
class Billions extends Api
{
public static function getApp($client)
{
$config = WeChatServer::getPayConfigBySource($client)['config'];
$app = Factory::payment($config);
return $app;
}
public function lists()
{
$page = $this->request->get('page_no', $this->page_no);

@ -51,7 +51,9 @@ class BillionsLogic extends Logic
->page($page,$size)->select();
}
$ids = [];
foreach ($list as &$v) {
$ids[] = $v['billions_id'];
if ($v['type'] == 1) {
$v->order_sn = Order::where('id', $v->order_id)->value('order_sn');
$v->name = Shop::where('id',$v->shop_id)->value('name');
@ -62,6 +64,9 @@ class BillionsLogic extends Logic
}
}
Billions::whereIn('billions_id', $ids)->where(['user_id' => $user_id])->update(['is_read' => 1]);
$count = Billions::alias('b')->where($where)->count();
// 商家最高补贴
@ -97,7 +102,8 @@ class BillionsLogic extends Logic
'highSubsidy' => $highSubsidy,
'getSubsidy' => $getSubsidy,
'queuesNumber' => $queuesNumber,
'queuesMoney' => $queuesMoney
'queuesMoney' => $queuesMoney,
'unread_billions' => $state == 1 ? self::getUnreadCount($user_id) : 0
];
return $data;
}