Skip to content

Commit c490110

Browse files
authored
Chat.php
修改相关文见
1 parent b0136d5 commit c490110

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

Chat.php

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: Administrator
5+
* Date: 2018/11/19
6+
* Time: 9:34
7+
*/
8+
9+
namespace app\index\controller;
10+
11+
12+
use think\Db;
13+
use think\Session;
14+
15+
class chat
16+
{
17+
function photo($id){
18+
19+
20+
$smeta=Db::name('shop')->where(array('id'=>$id))->value('smeta');
21+
$smeta=json_decode($smeta,true);
22+
23+
$photo='http://api.helianche.cn/'.$smeta['thumb'];
24+
25+
return $photo;
26+
}
27+
28+
function sid(){
29+
$arr="123337888999978999";
30+
$userinfo=Session::get('UserInfo');
31+
return $userinfo['id'];
32+
}
33+
34+
function save_message($k,$m,$n,$f){
35+
36+
// $redis=new Radis();
37+
// $redis->setChatRecord($k,$m,$n,$f);
38+
39+
$arr['message']=$n;
40+
$arr['touserid']=$k;
41+
$arr['fromuserid']=$m;
42+
$arr['status']=$f;
43+
$arr['time']=time();
44+
$res=Db::name('chat')->save($arr);
45+
return $res;
46+
}
47+
48+
49+
50+
}

0 commit comments

Comments
 (0)