获取医生提现记录列表
This commit is contained in:
parent
b8dd0463a2
commit
34421d2115
@ -7,6 +7,7 @@ namespace App\Model;
|
|||||||
|
|
||||||
|
|
||||||
use Hyperf\Database\Model\Collection;
|
use Hyperf\Database\Model\Collection;
|
||||||
|
use Hyperf\Database\Model\Relations\HasOne;
|
||||||
use Hyperf\Snowflake\Concern\Snowflake;
|
use Hyperf\Snowflake\Concern\Snowflake;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,6 +47,14 @@ class DoctorWithdrawal extends Model
|
|||||||
|
|
||||||
protected string $primaryKey = "withdrawal_id";
|
protected string $primaryKey = "withdrawal_id";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联银行表
|
||||||
|
*/
|
||||||
|
public function BasicBank(): HasOne
|
||||||
|
{
|
||||||
|
return $this->hasOne(BasicBank::class, 'bank_id', 'bank_id');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取信息-单条
|
* 获取信息-单条
|
||||||
* @param array $params
|
* @param array $params
|
||||||
@ -69,14 +78,30 @@ class DoctorWithdrawal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取某一时间区间数据
|
* 获取某一时间区间分页数据
|
||||||
* @param array $params
|
* @param array $params
|
||||||
* @param array $created_at_params
|
* @param array $created_at_params
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
* @return Collection|array
|
* @param int|null $page
|
||||||
|
* @param int|null $per_page
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function getDateList(array $params,array $created_at_params, array $fields = ['*']): Collection|array
|
public static function getDatePage(array $params,array $created_at_params, array $fields = ['*'], int $page = null, ?int $per_page = 10): array
|
||||||
{
|
{
|
||||||
return self::where($params)->whereBetween('created_at',$created_at_params)->get($fields);
|
$raw = self::with([
|
||||||
|
'BasicBank'
|
||||||
|
])
|
||||||
|
->where($params)
|
||||||
|
->whereBetween('created_at',$created_at_params)
|
||||||
|
->paginate($per_page, $fields, "page", $page);
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
$data['current_page'] = $raw->currentPage();// 当前页码
|
||||||
|
$data['total'] = $raw->total();//数据总数
|
||||||
|
$data['data'] = $raw->items();//数据
|
||||||
|
$data['per_page'] = $raw->perPage();//每页个数
|
||||||
|
$data['last_page'] = $raw->lastPage();//最后一页
|
||||||
|
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -262,7 +262,12 @@ class DoctorAccountService extends BaseService
|
|||||||
|
|
||||||
$params = array();
|
$params = array();
|
||||||
$params['doctor_id'] = $user_info['client_user_id'];
|
$params['doctor_id'] = $user_info['client_user_id'];
|
||||||
|
$doctor_withdrawal = DoctorWithdrawal::getDatePage($params,$created_at_params);
|
||||||
|
if (empty($doctor_withdrawal['data'])){
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
return success($doctor_withdrawal);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user