56 lines
1.6 KiB
PHP
56 lines
1.6 KiB
PHP
<?php
|
||
// +------------------------------------------------+
|
||
// |http://www.cjango.com |
|
||
// +------------------------------------------------+
|
||
// | 修复BUG不是一朝一夕的事情,等我喝醉了再说吧! |
|
||
// +------------------------------------------------+
|
||
// | Author: 小陈叔叔 <Jason.Chen> |
|
||
// +------------------------------------------------+
|
||
|
||
namespace app\system\controller;
|
||
|
||
use app\common\model\Withdrawal as WithdrawalModel;
|
||
use app\common\service\Excel;
|
||
use app\common\service\Withdrawal as WithdrawalService;
|
||
|
||
class Withdrawal extends _Init
|
||
{
|
||
|
||
public function index($nickname = '')
|
||
{
|
||
$model = new WithdrawalModel();
|
||
$model = $model->hasWhere('userinfo');
|
||
$map = [];
|
||
if ($nickname) {
|
||
$map["MemberInfo.nickname"] = ['like', "%$nickname%"];
|
||
}
|
||
$this->list = $model->where($map)->order('create_time desc')->paginate();
|
||
return $this->fetch('');
|
||
}
|
||
|
||
/**
|
||
* 修改提现状态
|
||
* @param [type] $id 提现id
|
||
* @param [type] $status 状态
|
||
* @return [type]
|
||
*/
|
||
public function status($status, $id)
|
||
{
|
||
$result = WithdrawalService::status($id, $status);
|
||
return $this->back($result);
|
||
}
|
||
|
||
public function toexcel($nickname = '')
|
||
{
|
||
$model = new WithdrawalModel();
|
||
$model = $model->hasWhere('userinfo');
|
||
$map = [];
|
||
if ($nickname) {
|
||
$map["MemberInfo.nickname"] = ['like', "%$nickname%"];
|
||
}
|
||
$list = $model->where($map)->order('create_time desc')->select();
|
||
|
||
Excel::withdrawal_excel($list);
|
||
}
|
||
}
|