61 lines
1.6 KiB
PHP
61 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller\purchase_order;
|
|
|
|
use app\admin\controller\BaseAdminController;
|
|
use app\admin\lists\purchase_order\PurchaseOrderLists;
|
|
use app\admin\lists\purchase_order_info\PurchaseOrderInfoLists;
|
|
use app\admin\lists\store_order\StoreOrderLists;
|
|
use app\admin\logic\purchase_order\PurchaseOrderLogic;
|
|
use app\common\model\purchase_order\PurchaseOrder;
|
|
|
|
class PurchaseOrderController extends BaseAdminController
|
|
{
|
|
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new PurchaseOrderLists());
|
|
}
|
|
public function info_lists()
|
|
{
|
|
return $this->dataLists(new PurchaseOrderInfoLists());
|
|
}
|
|
public function order_lists()
|
|
{
|
|
$id = $this->request->get('id');
|
|
$order_arr = PurchaseOrder::where('id', $id)->value('order_arr');
|
|
$this->request->__set('order_arr', $order_arr);
|
|
return $this->dataLists(new StoreOrderLists);
|
|
}
|
|
/**
|
|
* 合并今日商户订单
|
|
*/
|
|
public function add()
|
|
{
|
|
$data = $this->request->post();
|
|
PurchaseOrderLogic::mergeOrder($data);
|
|
if (PurchaseOrderLogic::hasError()) {
|
|
return $this->fail(PurchaseOrderLogic::getError());
|
|
}
|
|
return $this->success('合并成功');
|
|
}
|
|
/**
|
|
* 合并今日平台订单
|
|
*/
|
|
public function platform()
|
|
{
|
|
PurchaseOrderLogic::platformTodayOrder();
|
|
return $this->success('合并成功');
|
|
}
|
|
|
|
/**
|
|
* 详情
|
|
*/
|
|
public function detail()
|
|
{
|
|
$id = $this->request->get('id');
|
|
$res = PurchaseOrderLogic::detail($id);
|
|
return $this->data($res);
|
|
}
|
|
}
|