编程语言
首页 > 编程语言> > 姿薇优选源码

姿薇优选源码

作者:互联网

最近新开发了一款姿薇优选系统,其主要功能有预约系统,支付系统,商城系统,会员系统,积分系统,物流系统,赠送系统,实名认证系统等等。

姿薇优选系统客服系统源码分享:

<?php
namespace app\api\controller\user;

use app\models\store\StoreServiceLog;
use app\models\store\StoreService as StoreServiceModel;
use app\Request;
use crmeb\services\UtilService;

/**
 * 客服类
 * Class StoreService
 * @package app\api\controller\user
 */
class StoreService
{

    /**
     * 客服列表
     * @param Request $request
     * @return mixed
     */
    public function lst(Request $request)
    {
        list($page, $limit) = UtilService::getMore([['page',0],['limit',0]], $request, true);
//        if(!$page || !$limit) return app('json')->successful([]);
        $serviceInfoList = StoreServiceModel::lst($page, $limit);
        if(!count($serviceInfoList)) return app('json')->successful([]);
        return app('json')->successful($serviceInfoList->hidden(['notify', 'status', 'mer_id', 'add_time'])->toArray());
    }

    /**
     * 客服聊天记录
     * @param Request $request
     * @param $toUid
     * @return array
     */
    public function record(Request $request, $toUid)
    {
        list($page, $limit) = UtilService::getMore([['page',0],['limit',0]], $request, true);
        if(!$toUid) return app('json')->fail('参数错误');
        $uid = $request->uid();
        if(!$limit || !$page) return app('json')->successful([]);
        $serviceLogList = StoreServiceLog::lst($uid, $toUid, $page, $limit);
        if(!$serviceLogList) return app('json')->successful([]);
        $serviceLogList = $serviceLogList->hidden(['mer_id'])->toArray();
        $idArr = array_column($serviceLogList, 'id');
        array_multisort($idArr,SORT_ASC,$serviceLogList);
        return app('json')->successful($serviceLogList);
    }

}

  

标签:优选,return,serviceLogList,successful,app,json,源码,limit,姿薇
来源: https://www.cnblogs.com/v15528175269/p/16619061.html