37 lines
874 B
PHP
37 lines
874 B
PHP
<?php
|
|
|
|
namespace app\api\controller\order;
|
|
|
|
use app\api\logic\order\OrderLogic;
|
|
use app\api\controller\BaseApiController;
|
|
|
|
|
|
/**
|
|
* 采购单控制器
|
|
*/
|
|
class OpurchaseOrderController extends BaseApiController
|
|
{
|
|
|
|
public function checkOrder(){
|
|
|
|
$params=$this->request->get();
|
|
$res=OrderLogic::cartIdByPurchaseOrderInfo($this->request->userInfo,$params);
|
|
if($res==false){
|
|
return $this->fail(OrderLogic::getError());
|
|
}
|
|
return $this->data($res);
|
|
}
|
|
|
|
/**
|
|
* @notes 创建购货订单
|
|
*/
|
|
public function createOrder(){
|
|
$params=$this->request->post();
|
|
$order=OrderLogic::createOpurchaseOrder(request()->userInfo,$params);
|
|
if($order==false){
|
|
return $this->fail(OrderLogic::getError());
|
|
}else{
|
|
return $this->success('支付成功');
|
|
}
|
|
}
|
|
} |