29 lines
632 B
PHP
29 lines
632 B
PHP
|
|
<?
|
||
|
|
|
||
|
|
namespace controller\common\complaint;
|
||
|
|
|
||
|
|
use common\Complaint;
|
||
|
|
use ms\ms\structure\msControllerTable;
|
||
|
|
|
||
|
|
class Api extends msControllerTable {
|
||
|
|
|
||
|
|
static $class = 'common\Complaint';
|
||
|
|
|
||
|
|
static function send(){
|
||
|
|
$res = [];
|
||
|
|
$to = intval($_POST['to']);
|
||
|
|
$oid = intval($_POST['oid']);
|
||
|
|
$text = trim($_POST['text']);
|
||
|
|
if($to && $oid && $text) {
|
||
|
|
$r = Complaint::insert([
|
||
|
|
Complaint::$TO => $to,
|
||
|
|
Complaint::$OID => $oid,
|
||
|
|
Complaint::$TEXT => $text,
|
||
|
|
]);
|
||
|
|
$res['id'] = $r->id;
|
||
|
|
}
|
||
|
|
echo je($res);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|