1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-26 12:23:06 +08:00
2025-01-02 11:29:06 +08:00

39 lines
856 B
PHP

<?php
/**
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
* @license https://opensource.org/licenses/GPL-2.0
* @link https://www.koogua.com
*/
namespace App\Services\Logic\Consult;
use App\Traits\Client as ClientTrait;
use App\Validators\Consult as ConsultValidator;
trait ConsultDataTrait
{
use ClientTrait;
protected function handlePostData($post)
{
$data = [];
$data['client_type'] = $this->getClientType();
$data['client_ip'] = $this->getClientIp();
$validator = new ConsultValidator();
if (isset($post['question'])) {
$data['question'] = $validator->checkQuestion($post['question']);
}
if (isset($post['private'])) {
$data['private'] = $validator->checkPrivateStatus($post['private']);
}
return $data;
}
}