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

73 行
1.8 KiB
PHP

<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 商家档案
*
* @icon fa fa-circle-o
*/
class Merchant extends Backend
{
/**
* Merchant模型对象
* @var \app\admin\model\Merchant
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Merchant;
$this->view->assign("settleTypeList", $this->model->getSettleTypeList());
$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'));
}
// 查询商户派发的工单记录
$recentOrders = \think\Db::name('order')
->where('user_id', $row['user_id'])
->order('id desc')
->limit(6)
->select();
$this->view->assign('row', $row);
$this->view->assign('recentOrders', $recentOrders);
return $this->view->fetch();
}
}