diff --git a/app/.gitignore b/app/.gitignore index baf0980..02cc49f 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1,2 +1 @@ -/api /home \ No newline at end of file diff --git a/app/api/controller/Message.php b/app/api/controller/Message.php new file mode 100644 index 0000000..08e39ac --- /dev/null +++ b/app/api/controller/Message.php @@ -0,0 +1,38 @@ +id; + $result = MessageTo::create(['send_id'=>$sendId,'receve_id'=>$receveId,'message_id'=>$msgId]); + if($result){ + return true; + } + + } + + //receve msg + public function receveMsg($uid) + { + $msg = Db::name('message_to') + ->alias('t') + ->join('message m','t.message_id = m.id' ) + ->join('user u','t.send_id = u.id') + ->field('t.id as id,name,title,link,receve_id,t.create_time as create_time') + ->where('t.receve_id',$uid) + ->where('t.delete_time',0) + ->select(); + return $msg; + } + +} \ No newline at end of file