1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace app\common\model;
- use think\Model;
- use app\common\library\Easemob;
- class Message extends Model
- {
-
- protected $autoWriteTimestamp = 'int';
-
- protected $createTime = 'createtime';
-
- public static function addMessage($user_id,$title,$content,$infotype = '',$infotype_id = 0) {
- if(!$user_id || !$title || !$content) {
- return false;
- }
-
-
-
-
- $data = [];
- $data["user_id"] = $user_id;
- $data["title"] = $title;
- $data["content"] = $content;
- $data["createtime"] = time();
- $data["status"] = 0;
- $data["infotype"] = $infotype;
- $data["infotype_id"] = $infotype_id;
- return self::insertGetId($data);
- }
- }
|