<?php
/*
 * @Descripttion:
 * @version:
 * @Author: kangkang
 * @Date: 2020-10-13 19:52:37
 * @LastEditors: kangkang
 * @LastEditTime: 2020-10-16 19:10:51
 */
/*
 * @Descripttion:
 * @version:
 * @Author: kangkang
 * @Date: 2020-10-13 19:52:37
 * @LastEditors: kangkang
 * @LastEditTime: 2020-10-14 20:04:16
 */

namespace app\order\controller;

use app\order\model\ProductOrder;
use fastphp\base\Controller;

class Failed extends Controller
{
    public function getFailedList()
    {
        $page = 0;
        if (isset($_GET['PageIndex'])) {
            $page = ($_GET['PageIndex'] - 1) * 50;
        }
        if (isset($_GET['ProductId'])){
            $where['ProductId'] = $_GET['ProductId'];
        }
        if (isset($_GET['PackageId'])){
            $where['PackageId'] = $_GET['PackageId'];
        }
        if (!empty($_GET['keyWord'])){
            $where['OrderNo'] = $_GET['keyWord'];
        }
        $where['Remark'] = ['like','%失败%'];
        
        $productOrder = new ProductOrder;
        $list = $productOrder->getListPage($where, '*', 'id desc', "0,50");

        
        $data = [
            'Code' => 10000,
            'Data' => $list,
            'Message' => '',
            'TotalCount' => 50
        ];
        echo json_encode($data);
    }
}
