增加:管理后台 - 股东列表相关接口
This commit is contained in:
parent
c8a9c76b22
commit
b2da511be8
|
|
@ -46,6 +46,12 @@ class MerchantShareholderDao extends BaseDao{
|
|||
->with([
|
||||
'user' => function($query){
|
||||
$query->field('uid,nickname,avatar,phone');
|
||||
},
|
||||
'merchant' => function($query){
|
||||
$query->field('mer_id,mer_avatar,mer_name');
|
||||
},
|
||||
'level' => function($query){
|
||||
$query->field('id,title as level_name')->bind(['level_name']);
|
||||
}
|
||||
])
|
||||
->order('create_time DESC,id DESC');
|
||||
|
|
|
|||
|
|
@ -21,6 +21,13 @@ class MerchantShareholder extends BaseModel{
|
|||
return $this->hasOne(User::class, 'uid', 'uid');
|
||||
}
|
||||
|
||||
public function merchant(){
|
||||
return $this->hasOne(Merchant::class,'mer_id','mer_id');
|
||||
}
|
||||
|
||||
public function level(){
|
||||
return $this->hasOne(MerchantShareholderLevel::class,'id','level_id');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
<?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']);
|
||||
$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('删除成功');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -73,7 +73,7 @@ class ShareholderLevel extends BaseController{
|
|||
return app('json')->success('编辑成功');
|
||||
}
|
||||
/**
|
||||
* Common: 生成信息
|
||||
* Common: 删除信息
|
||||
* Author: wu-hui
|
||||
* Time: 2024/06/12 14:44
|
||||
* @param $id
|
||||
|
|
|
|||
|
|
@ -168,7 +168,8 @@ Route::group(function () {
|
|||
Route::post('shareholder_level/get_form','.ShareholderLevel/getEditForm')->name('systemMerchantShareholderLevelGetForm');
|
||||
Route::post('shareholder_level/set_form','.ShareholderLevel/setEditForm')->name('systemMerchantShareholderLevelSetForm');
|
||||
Route::post('shareholder_level/del_info/:id','.ShareholderLevel/delInfo')->name('systemMerchantShareholderLevelDelInfo');
|
||||
|
||||
Route::get('shareholder/list','.Shareholder/getList')->name('systemMerchantShareholderGetList');
|
||||
Route::post('shareholder/del_info/:id','.Shareholder/delInfo')->name('systemMerchantShareholderDelInfo');
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue