new-admin-api/app/controller/admin/system/merchant/Shareholder.php

49 lines
1.3 KiB
PHP

<?php
namespace app\controller\admin\system\merchant;
use app\common\repositories\system\merchant\MerchantShareholderRepository;
use crmeb\basic\BaseController;
use think\App;
class Shareholder extends BaseController{
protected $repository;
public function __construct(App $app, MerchantShareholderRepository $repository){
parent::__construct($app);
$this->repository = $repository;
}
/**
* Common: 信息列表
* Author: wu-hui
* Time: 2024/06/14 17:22
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getList(){
[$page, $limit] = $this->getPage();
$params = $this->request->params(['level_id','mer_id','uid','search_text', 'merchant_type']);
$data = $this->repository->getList((array)$params,(int)$page,(int)$limit);
return app('json')->success($data);
}
/**
* Common: 删除信息
* Author: wu-hui
* Time: 2024/06/14 17:38
* @param $id
* @return mixed
*/
public function delInfo($id){
$this->repository->getSearchModel(['id' => $id])->delete();
return app('json')->success('删除成功');
}
}