修改模型

This commit is contained in:
邹景立 2021-09-13 15:23:36 +08:00
parent 55f93479ad
commit dfcb91ca6d
3 changed files with 4 additions and 5 deletions

View File

@ -68,8 +68,7 @@ class Address extends Auth
*/
public function get()
{
$model = DataUserAddress::mk();
$query = $this->_query($model)->withoutField('deleted');
$query = DataUserAddress::mQuery()->withoutField('deleted');
$query->equal('code')->where(['uuid' => $this->uuid, 'deleted' => 0]);
$result = $query->order('type desc,id desc')->page(false, false, false, 15);
$this->success('获取地址数据!', $result);

View File

@ -20,7 +20,7 @@ class Balance extends Auth
*/
public function get()
{
$query = $this->_query(DataUserBalance::class);
$query = DataUserBalance::mQuery();
$query->withoutField('deleted,create_by')->where(['uuid' => $this->uuid, 'deleted' => 0]);
$result = $query->like('create_at#date')->order('id desc')->page(true, false, false, 10);
$this->success('获取数据成功', $result);

View File

@ -91,9 +91,9 @@ class Transfer extends Controller
$this->title = '用户提现管理';
$this->transfer = UserTransferService::instance()->amount(0);
// 创建查询对象
$query = $this->_query(DataUserTransfer::mk())->order('id desc');
$query = DataUserTransfer::mq()->order('id desc');
// 用户条件搜索
$db = $this->_query(DataUser::class)->like('phone,username|nickname#nickname')->db();
$db = DataUser::mq()->like('phone,username|nickname#nickname')->db();
if ($db->getOptions('where')) $query->whereRaw("uuid in {$db->field('id')->buildSql()}");
// 数据列表处理
$query->equal('type,status')->dateBetween('create_at')->page();