文件
yjyf/server/application/admin/controller/Master.php
YuanWen 78d45eea74 chore: 新增epay和cos插件相关类库及配置文件
- 新增epay v2、v3、v3new版本的支付类库及证书文件
- 新增cos云存储类库文件
- 调整文件上传保存格式为按分类存储
- 修复会员、规则、类目等语言翻译键名
- 新增小程序图标等静态资源文件
2026-11-04 09:33:57 +08:00

89 行
2.3 KiB
PHP

<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 师傅档案
*
* @icon fa fa-circle-o
*/
class Master extends Backend
{
/**
* Master模型对象
* @var \app\admin\model\Master
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Master;
$this->view->assign("workStatusList", $this->model->getWorkStatusList());
$this->view->assign("verifyStatusList", $this->model->getVerifyStatusList());
}
protected $relationSearch = true;
public function index()
{
$this->request->filter(['strip_tags', 'trim']);
if (false === $this->request->isAjax()) {
return $this->view->fetch();
}
if ($this->request->request('keyField')) {
return $this->selectpage();
}
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
$list = $this->model
->with(['user'])
->where($where)
->order($sort, $order)
->paginate($limit);
$result = ['total' => $list->total(), 'rows' => $list->items()];
return json($result);
}
/**
* 师傅全景档案画像
*/
public function detail($ids = null)
{
$row = $this->model->with(['user'])->find($ids);
if (!$row) {
$this->error(__('No Results were found'));
}
// 1. 最近接单记录
$recentOrders = \think\Db::name('order')
->where('master_id', $row['id'])
->order('id desc')
->limit(6)
->select();
// 2. 提现流水
$recentWithdraws = \think\Db::name('withdraw')
->where('master_id', $row['id'])
->order('id desc')
->limit(5)
->select();
// 3. 服务好评记录
$recentReviews = \think\Db::name('review')
->where('master_id', $row['id'])
->order('id desc')
->limit(5)
->select();
$this->view->assign('row', $row);
$this->view->assign('recentOrders', $recentOrders);
$this->view->assign('recentWithdraws', $recentWithdraws);
$this->view->assign('recentReviews', $recentReviews);
return $this->view->fetch();
}
}