192 lines
3.0 KiB
PHP
192 lines
3.0 KiB
PHP
<?php
|
|
namespace app\farm\controller;
|
|
use app\AdminRest;
|
|
use app\farm\model\BalanceCard;
|
|
use app\farm\model\BalanceOrder;
|
|
|
|
|
|
use think\App;
|
|
use think\facade\Db;
|
|
|
|
|
|
class AdminBalance extends AdminRest
|
|
{
|
|
|
|
|
|
protected $model;
|
|
|
|
protected $order_model;
|
|
|
|
|
|
public function __construct(App $app) {
|
|
|
|
parent::__construct($app);
|
|
|
|
$this->model = new BalanceCard();
|
|
|
|
$this->order_model = new BalanceOrder();
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
* @author chenniang
|
|
* @DataTime: 2021-07-04 19:09
|
|
* @功能说明:储值充值卡列表
|
|
*/
|
|
public function cardList(){
|
|
|
|
$input = $this->_param;
|
|
|
|
$dis[] = ['uniacid','=',$this->_uniacid];
|
|
|
|
$dis[] = ['status','>',-1];
|
|
|
|
if(!empty($input['name'])){
|
|
|
|
$dis[] = ['title','like','%'.$input['name'].'%'];
|
|
|
|
}
|
|
|
|
$data = $this->model->dataList($dis,$input['limit']);
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* @author chenniang
|
|
* @DataTime: 2021-07-04 18:56
|
|
* @功能说明:添加充值卡
|
|
*/
|
|
public function cardAdd(){
|
|
|
|
$input = $this->_input;
|
|
|
|
$input['uniacid'] = $this->_uniacid;
|
|
|
|
$res = $this->model->dataAdd($input);
|
|
|
|
return $this->success($res);
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
* @author chenniang
|
|
* @DataTime: 2021-07-04 18:57
|
|
* @功能说明:编辑充值卡
|
|
*/
|
|
public function cardUpdate(){
|
|
|
|
$input = $this->_input;
|
|
|
|
$dis = [
|
|
|
|
'id' => $input['id']
|
|
];
|
|
|
|
$res = $this->model->dataUpdate($dis,$input);
|
|
|
|
return $this->success($res);
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
* @author chenniang
|
|
* @DataTime: 2021-07-04 18:59
|
|
* @功能说明:充值卡详情
|
|
*/
|
|
public function cardInfo(){
|
|
|
|
$input = $this->_param;
|
|
|
|
$dis = [
|
|
|
|
'id' => $input['id']
|
|
];
|
|
|
|
$res = $this->model->dataInfo($dis);
|
|
|
|
return $this->success($res);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* @author chenniang
|
|
* @DataTime: 2021-07-04 19:09
|
|
* @功能说明:储值订单列表
|
|
*/
|
|
public function orderList(){
|
|
|
|
$input = $this->_param;
|
|
|
|
$dis[] = ['uniacid','=',$this->_uniacid];
|
|
|
|
$dis[] = ['status','>',1];
|
|
|
|
if(!empty($input['name'])){
|
|
|
|
$dis[] = ['title','like','%'.$input['name'].'%'];
|
|
|
|
}
|
|
|
|
if(!empty($input['order_code'])){
|
|
|
|
$dis[] = ['order_code','like','%'.$input['order_code'].'%'];
|
|
|
|
}
|
|
|
|
if(!empty($input['start_time'])){
|
|
|
|
$dis[] = ['pay_time','between',"{$input['start_time']},{$input['end_time']}"];
|
|
|
|
}
|
|
|
|
$data = $this->order_model->dataList($dis,$input['limit']);
|
|
|
|
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* @author chenniang
|
|
* @DataTime: 2021-07-04 18:59
|
|
* @功能说明:充值订单详情
|
|
*/
|
|
public function orderInfo(){
|
|
|
|
$input = $this->_input;
|
|
|
|
$dis = [
|
|
|
|
'id' => $input['id']
|
|
];
|
|
|
|
$res = $this->order_model->dataInfo($dis);
|
|
|
|
return $this->success($res);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|