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