Complaints.php 1.59 KB
<?php

namespace Home;

use LibModels\Web\Home\ComplaintsData;
use Configs\ChannelConfig;

/**
 * 个人中心-我的投诉
 */
class ComplaintsModel
{

    public static function getComplaintsList($uid, $page, $limit)
    {
        $complaints = array();
        $complaintsInfo = ComplaintsData::getComplaintsList($uid, $page, $limit);
        if (isset($complaintsInfo['data']['complaintList']) && $complaintsInfo['data']['complaintList']) {
            foreach ($complaintsInfo['data']['complaintList'] as $ck => $cv) {
                $complaints[$ck]['id'] = $cv['id'];
                $complaints[$ck]['title'] = $cv['title'];
                $complaints[$ck]['target'] = $cv['customer'];
                $complaints[$ck]['type'] = ChannelConfig::$complaintType[$cv['complaintsType']];
                $complaints[$ck]['order'] = $cv['orderCode'];
                $complaints[$ck]['time'] = $cv['createTime'];
                $complaints[$ck]['question'] = $cv['content'];
                $complaints[$ck]['reply'] = $cv['reply'];
                $complaints[$ck]['replyTime'] = $cv['replyTime'];
                $complaints[$ck]['revoke'] = ($cv['status'] == -1) ? true : false;
            }
            $complaints['pager']['total'] = $complaintsInfo['data']['total'];
            $complaints['pager']['pageTotal'] = $complaintsInfo['data']['page_total'];
            $complaints['pager']['page'] = $complaintsInfo['data']['page'];
        }
        else {
            $complaints = array('empty' => '您尚未投诉任何内容');
        }
        return $complaints;
    }

}