Commit f4756c71 authored by zhoujun's avatar zhoujun

预警接口

parent 95564d73
Pipeline #2073 passed with stage
in 0 seconds
......@@ -8,5 +8,5 @@ class WarnConfigModel extends BaseModel
{
use SoftDeletes;
protected $connection = 'mysql';
protected $table = 'club_warn_config';
protected $table = 'club_warn_log';
}
......@@ -343,27 +343,28 @@ class WarnService implements IWarnService
})->when($end > 0, function ($query) use ($end) {
$endTime = date('Y-m-d H:i:s',strtotime($end) + 1);
return $query->where('send_time','<',$endTime);
})->select('id','platform','channel','cash','status','config_id','people_id','msg','remark','send_time','created_at')->orderBy('id', 'DESC')->paginate($pagePerNum, ['*'], 'currentPage', $currentPage);
})->select('id','platform','channel','status','type','config_id','people_id','msg','remark','send_time','created_at')->orderBy('id', 'DESC')->paginate($pagePerNum, ['*'], 'currentPage', $currentPage);
$array['totalNum'] = $lists->total();
$array['totalPage'] = $lists->lastPage();
$platformArr = config(env('ENVIRONMENT') . '.PLATFORM');
$channelArr = config(env('ENVIRONMENT') . '.CHANNEL');
$typeArr = config(env('ENVIRONMENT') . '.CURRENCY');
foreach ($lists as $list) {
$tem['id'] = $list->id;
$tem['platform'] = $platformArr[$list->platform] ?? '';
$tem['channel'] = $channelArr[$list->channel] ?? '';
$tem['type'] = $typeArr[$list->type] ?? '';
$tem['oneWithdrawal'] = sprintf('%.2f',$list->one_withdrawal / 100);
$tem['dayWithdrawal'] = sprintf('%.2f',$list->day_withdrawal / 100);
$tem['userDayWithdrawal'] = sprintf('%.2f',$list->people_day_withdrawal / 100);
$tem['amount'] = sprintf('%.2f',$list->cash / 100);
$tem['oneWithdrawal'] = 0.00;
$tem['dayWithdrawal'] = 0.00;
$tem['userDayWithdrawal'] = 0.00;
$tem['configId'] =$list->config_id;
$tem['peopleId'] =$list->people_id;
$tem['status'] = $list->status;
$statusName = '停用';
if($list->status == 1) $statusName = '正常';
$statusName = '已发送';
if($list->status == 0) $statusName = '未发送';
$tem['statusName'] = $statusName;
$tem['optionUser'] = $list->op_user;
$tem['createdAt'] = Carbon::parse($list->created_at)->format('Y-m-d H:i:s');
$tem['msg'] = $list->msg;
$tem['createdAt'] = $list->send_time;
$array['data'][] = $tem;
}
unset($lists, $list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment