105 lines
2.8 KiB
PHP
105 lines
2.8 KiB
PHP
<?php
|
|
|
|
namespace addon\alilife\shop\controller;
|
|
|
|
use addon\alilife\model\Goods as GoodsModel;
|
|
use app\shop\controller\BaseShop;
|
|
use addon\alilife\model\Order as OrderModel;
|
|
|
|
class Order extends BaseShop
|
|
{
|
|
public function syncRepair()
|
|
{
|
|
$trade_no = input('trade_no', '');
|
|
$order_id = input('order_id', '');
|
|
$order = new OrderModel();
|
|
$res = $order->syncRepair($trade_no, $order_id, $this->site_id);
|
|
return $res;
|
|
}
|
|
|
|
|
|
public function syncDelivery()
|
|
{
|
|
$order_id = input('order_id', '');
|
|
$order_status = input('order_status', '');
|
|
$order = new OrderModel();
|
|
$res = $order->syncDelivery($order_id, $order_status);
|
|
return $res;
|
|
}
|
|
|
|
/***
|
|
* 直接退款
|
|
* @return null
|
|
*/
|
|
public function refund()
|
|
{
|
|
$trade_no = input('trade_no', '');
|
|
$order_id = input('order_id', '');
|
|
$order = new OrderModel();
|
|
$res = $order->refund($trade_no, $order_id, $this->site_id);
|
|
return $res;
|
|
}
|
|
|
|
|
|
/***
|
|
* 获取支付宝对账单
|
|
* @return array|mixed
|
|
*/
|
|
public function miniOrderItembill()
|
|
{
|
|
if (request()->isAjax()) {
|
|
$goods_model = new GoodsModel();
|
|
$page = input('page', 1);
|
|
$page_size = input('page_size', PAGE_LIST_ROWS);
|
|
$condition = [
|
|
'page_num' => $page,
|
|
'page_size' => $page_size,
|
|
];
|
|
$order_status = input('order_status');
|
|
$settle_status = input('settle_status');
|
|
$create_time = input('create_time');
|
|
$settlement_date = input('settlement_date');
|
|
$service_type_list = input('service_type_list');
|
|
if ($order_status) {
|
|
$condition['order_status'] = $order_status;
|
|
}
|
|
if ($settle_status) {
|
|
$condition['settle_status'] = $settle_status;
|
|
}
|
|
if ($create_time) {
|
|
$condition['create_time'] = $create_time;
|
|
}
|
|
if ($create_time) {
|
|
$condition['settlement_date'] = $settlement_date;
|
|
}
|
|
if ($service_type_list) {
|
|
$condition['service_type_list'] = json_encode([$service_type_list]);
|
|
}
|
|
$res = $goods_model->getBillList($condition, $page, $this->site_id);
|
|
return $res;
|
|
}
|
|
return $this->fetch('bill/lists');
|
|
}
|
|
|
|
|
|
/***
|
|
* 确认收货
|
|
* @return array
|
|
*/
|
|
public function confirmreceipt()
|
|
{
|
|
if (request()->isAjax()) {
|
|
$order_id = input('order_id', '');
|
|
$order = new OrderModel();
|
|
$res = $order->takeDelivery($order_id, 1);
|
|
return $res;
|
|
}
|
|
}
|
|
|
|
|
|
public function detail()
|
|
{
|
|
|
|
|
|
}
|
|
} |