meraproject/module/common/complaint/controller.php
keboss-m 5c21d25d45 Initial commit: Merakomis portal, Docker stack and user-reader API.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:04:05 +03:00

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);
}
}