公共退款界面
This commit is contained in:
41
app/order/controller/OpenRefund.php
Normal file
41
app/order/controller/OpenRefund.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace app\order\controller;
|
||||
|
||||
use app\order\model\ProductOrder as PoductOrderModel;
|
||||
use enum\order\ProductOrder as ProductOrderEnum;
|
||||
|
||||
class OpenRefund
|
||||
{
|
||||
/**
|
||||
* @description: 获取数据
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
public function getList()
|
||||
{
|
||||
$page = 0;
|
||||
$where = [];
|
||||
$where2 = '';
|
||||
if (isset($_GET['PageIndex'])) {
|
||||
$page = ($_GET['PageIndex'] - 1) * 50;
|
||||
}
|
||||
if (isset($_GET['Btime'])){
|
||||
$date1 = date('Y-m-d', strtotime($_GET['Btime']));
|
||||
$date2 = date('Y-m-d', strtotime($_GET['Etime']));
|
||||
$where2 .= " UpdateTime>='" . $date1 . "' and UpdateTime<='" . $date2 . "' ";
|
||||
}
|
||||
if (isset($_GET['ProductIds'])){
|
||||
$where['ProductId'] = $_GET['ProductIds'];
|
||||
}
|
||||
$product_order_model = new PoductOrderModel;
|
||||
$product_order_enum = new ProductOrderEnum;
|
||||
$where['OrderType'] = $product_order_enum::$Refund;
|
||||
$list = $product_order_model->openGetList($where, 'CreateTime,ProductName,PackageName,ConnectCount*AccountCount ConnectCount,Accounts,RefundRestTime', 'id desc', "$page,50", $where2);
|
||||
$data = [
|
||||
'list' => $list,
|
||||
'count' => $product_order_model->getCount($where)
|
||||
];
|
||||
\result($data);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@
|
||||
* @version:
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-10-16 14:44:02
|
||||
* @LastEditors: kangkang
|
||||
* @LastEditTime: 2020-10-16 15:53:03
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2020-12-03 16:45:11
|
||||
*/
|
||||
|
||||
namespace app\order\model;
|
||||
@@ -15,4 +15,14 @@ use fastphp\base\Model;
|
||||
class ProductOrder extends Model
|
||||
{
|
||||
protected $table = 'product_order';
|
||||
|
||||
/**
|
||||
* @description: 获取退款数据
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
public function openGetList($where = [], $fields = '*', $order = 'id desc', $limit = '50', $where2 = '')
|
||||
{
|
||||
return $this->field($fields)->where($where)->where($where2)->order($order)->limit($limit)->fetchAll();
|
||||
}
|
||||
}
|
||||
|
||||
20
app/product/controller/OpenProduct.php
Normal file
20
app/product/controller/OpenProduct.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace app\product\controller;
|
||||
|
||||
use app\product\model\Product as PoductModel;
|
||||
|
||||
class OpenProduct
|
||||
{
|
||||
/**
|
||||
* @description: 获取数据
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
public function getOpenList()
|
||||
{
|
||||
$product = new PoductModel;
|
||||
$list = $product->getList([], 'Id,Name', 'Sort asc');
|
||||
\result($list);
|
||||
}
|
||||
}
|
||||
19
app/product/model/Product.php
Normal file
19
app/product/model/Product.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/*
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-10-22 16:13:41
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2020-12-03 16:28:11
|
||||
*/
|
||||
|
||||
|
||||
namespace app\product\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class Product extends Model
|
||||
{
|
||||
protected $table = 'product';
|
||||
}
|
||||
Reference in New Issue
Block a user