| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace services\common;
- use common\models\common\Report;
- /**
- * Class ReportService
- * @package services\common
- */
- class ReportService extends BaseService
- {
- /**
- * 添加举报
- *
- * @param integer $id
- * @param string $from
- * @param array $data
- * @return boolean
- */
- public function addReport(int $id, string $from, array $data)
- {
- if (!in_array($from, Report::getFromKeys())) return $this->error('来源类型错误');
- if (!Report::addReport($this->mall_id, $id, $from, $data)) {
- return $this->error('添加投诉失败');
- }
-
- return true;
- }
- }
|