全栈小学生 011cbe96f9 update
2024-06-25 10:09:57 +08:00

64 lines
2.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\service\admin\verify;
use app\model\verify\Verify;
use core\base\BaseAdminService;
/**
* 订单核销
* Class VerifyService
* @package app\service\admin\verify
*/
class VerifyService extends BaseAdminService
{
public function __construct()
{
parent::__construct();
$this->model = new Verify();
}
/**
* 获取核销记录列表
* @param array $where
* @return array
* @throws \think\db\exception\DbException
*/
public function getPage(array $where = []) {
$search_model = $this->model->where([['id', '>', 0]])->withSearch(['code', 'type', 'create_time', 'verifier_member_id'], $where)
->with(['member' => function($query){
$query->field('member_id, nickname, mobile, headimg');
}])->field('*')->order('create_time desc')->append(['type_name']);
$list = $this->pageQuery($search_model);
return $list;
}
/**
* 获取核销信息
* @param string $verify_code
* @return array
*/
public function getDetail(string $verify_code) {
$info = $this->model->where([
['code', '=', $verify_code]
])->field('*')
->with(['member' => function($query){
$query->field('member_id, nickname, mobile, headimg');
}])->append(['type_name'])->findOrEmpty()->toArray();
$info['verify_info'] = event('VerifyInfo',$info);
return $info;
}
}