quanwei
2025-11-01 121b714d710cf3c865f4a1b5efe81abec11056d1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
 
namespace app\supplier\controller\order;
 
use app\supplier\controller\Controller;
use app\supplier\model\order\Order as OrderModel;
 
/**
 * 订单操作
 * @package app\shop\controller\order
 */
class Operate extends Controller
{
    /**
     * 订单导出
     */
    public function export($dataType)
    {
        $model = new OrderModel();
        return $model->exportList($dataType, $this->postData(), $this->getSupplierId());
    }
 
    /**
     * 审核:用户取消订单
     */
    public function confirmCancel($order_id)
    {
        $model = OrderModel::detail($order_id);
        if ($model->confirmCancel($this->postData())) {
            return $this->renderSuccess('操作成功');
        }
        return $this->renderError('操作失败');
    }
 
    /**
     * 门店自提核销
     */
    public function extract()
    {
        $params = $this->postData('extract_form');
        if(!isset($params['order']['extract_clerk_id'])){
            return $this->renderError('核销人员不能为空');
        }
        $model = OrderModel::detail($params['order_id']);
        if ($model->verificationOrder($params['order']['extract_clerk_id'])) {
            return $this->renderSuccess('核销成功');
        }
        return $this->renderError($model->getError() ?: '核销失败');
    }
 
    /**
     * 批量发货
     */
    public function batchDelivery(){
        // 文件信息
        $fileInfo = request()->file('iFile');
        $model = new OrderModel();
        if($model->batchDelivery($fileInfo, $this->getSupplierId())){
            return $this->renderSuccess('批量发货成功');
        }
        return $this->renderError($model->getError() ?: '批量发货失败');
    }
}