...
|
...
|
@@ -20,6 +20,18 @@ use think\Validate; |
|
|
*/
|
|
|
class OrderController extends RestBaseController
|
|
|
{
|
|
|
|
|
|
public function _initialize()
|
|
|
{
|
|
|
$user_id = $this->getUserId();
|
|
|
$data = Db::name('integral')
|
|
|
->where('user_id',$user_id)
|
|
|
->find();
|
|
|
if(empty($data)){
|
|
|
$this->error(['code'=>40005,'msg'=>'请先注册']);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 创建订单
|
|
|
* @description
|
...
|
...
|
@@ -36,12 +48,6 @@ class OrderController extends RestBaseController |
|
|
*/
|
|
|
public function createOrder(){
|
|
|
$user_id = $this->getUserId();
|
|
|
$data = Db::name('integral')
|
|
|
->where('user_id',$user_id)
|
|
|
->find();
|
|
|
if(empty($data)){
|
|
|
$this->error('请先注册!');
|
|
|
}
|
|
|
$total = $this->request->param('total');
|
|
|
$pay_id = $this->request->param('pay_id');
|
|
|
if(empty($total)){
|
...
|
...
|
@@ -107,4 +113,53 @@ class OrderController extends RestBaseController |
|
|
return $openid;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 提现
|
|
|
* @author Guosheng
|
|
|
* @url /index/order/pay
|
|
|
* @method GET
|
|
|
*
|
|
|
* @header name:XX-Token require:1 default: desc:token
|
|
|
*
|
|
|
* @param name:order_id type:int require:1 other: desc:订单id
|
|
|
*/
|
|
|
public function deposit()
|
|
|
{
|
|
|
$id = $this->getUserId();
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 积分明细
|
|
|
* @description
|
|
|
* @author GuoSheng
|
|
|
* @url /index/Order/detail
|
|
|
* @method GET
|
|
|
*
|
|
|
* @header name:XX-Token require:1 default: desc:token
|
|
|
*
|
|
|
* @param name:page type:int require:0 other: desc:当前页(默认1)
|
|
|
* @param name:pageNum type:int require:0 other: desc:每页显示数据个数(默认10)
|
|
|
*
|
|
|
* @return type:类型(1充值,2兑换商品,3获得奖励,4提现)
|
|
|
* @return total: 变动的积分
|
|
|
* @return create_time: 创建时间
|
|
|
*/
|
|
|
public function detail()
|
|
|
{
|
|
|
$user_id = $this->getUserId();
|
|
|
$page = $this->request->param('page',1,'intval');
|
|
|
$pageNum = $this->request->param('pageNum',10,'intval');
|
|
|
$list = Db::name('detail')
|
|
|
->where('user_id',$user_id)
|
|
|
->field('id,user_id,type,total,create_time')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
foreach ($list as &$v){
|
|
|
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
|
|
}
|
|
|
$this->success('SUCCESS',$list);
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|