<?php
|
|
namespace app\shop\controller\branch;
|
|
use app\shop\controller\Controller;
|
use app\shop\model\branch\Cash as BranchCashModel;
|
use app\shop\model\branch\Branch as BranchModel;
|
|
/**
|
* 供应商提现控制器
|
*/
|
class Cash extends Controller
|
{
|
/**
|
* 提现列表
|
*/
|
public function index()
|
{
|
//获取该角色管理的区域 by yj 2023.12.20
|
$branch_ids = BranchModel::getBranchIdsByUser($this->store['user']);
|
$model = new BranchCashModel;
|
$postData = $this->postData();
|
if(!empty($branch_ids)){
|
$postData["branch_ids"] = $branch_ids;
|
}
|
$list = $model->getList($postData);
|
return $this->renderSuccess('', compact('list'));
|
}
|
|
/**
|
* 提现审核
|
*/
|
public function submit($id)
|
{
|
$model = BranchCashModel::detail($id);
|
if ($model->submit($this->postData())) {
|
return $this->renderSuccess('操作成功');
|
}
|
return $this->renderError($model->getError() ?: '操作失败');
|
}
|
|
/**
|
* 确认打款
|
*/
|
public function money($id)
|
{
|
$model = BranchCashModel::detail($id);
|
|
if ($model->money()) {
|
return $this->renderSuccess('操作成功');
|
}
|
return $this->renderError($model->getError() ?: '操作失败');
|
}
|
}
|