You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.2 KiB
49 lines
1.2 KiB
<?php
|
|
|
|
namespace app\distribution\model;
|
|
|
|
use app\base\model\user\UserInfo;
|
|
use think\model\concern\SoftDelete;
|
|
|
|
class DistributionCommissionIncome extends Base
|
|
{
|
|
use SoftDelete;
|
|
|
|
// 设置字段自动转换类型
|
|
protected $type = [
|
|
'remark' => 'serialize',
|
|
'arrival_time' => 'timestamp',
|
|
'create_time' => 'timestamp:Y.m.d H:i',
|
|
];
|
|
|
|
|
|
/**
|
|
* 查找全部数据--带分页
|
|
* @2022-05-25
|
|
*/
|
|
public function getIncomeList($where, $page, $field = '*', $order = '', $per_page_number = 10)
|
|
{
|
|
$primary_key_name = $this->getPk();
|
|
|
|
if (empty($order)) {
|
|
$order = (empty($data[$primary_key_name]) ? 'id' : $data[$primary_key_name]) . ' desc';
|
|
}
|
|
|
|
$dataList = $this->with(['userInfo'])->field($field)->where($where)->order($order)
|
|
->paginate(['list_rows' => $per_page_number, 'page' => $page], false);
|
|
|
|
return $dataList;
|
|
}
|
|
|
|
/**
|
|
* 一对一关联用户信息
|
|
* @date 2022-05-25
|
|
*/
|
|
public function userInfo()
|
|
{
|
|
return $this->hasOne(UserInfo::class, 'user_id', 'user_id')->bind([
|
|
'user_head_img' => 'head_img',
|
|
'user_nick_name' => 'nick_name'
|
|
]);
|
|
}
|
|
} |