77 lines
2.1 KiB
PHP
77 lines
2.1 KiB
PHP
<?php
|
||
// +------------------------------------------------+
|
||
// |http://www.cjango.com |
|
||
// +------------------------------------------------+
|
||
// | 修复BUG不是一朝一夕的事情,等我喝醉了再说吧! |
|
||
// +------------------------------------------------+
|
||
// | Author: 小陈叔叔 <Jason.Chen> |
|
||
// +------------------------------------------------+
|
||
namespace app\mobile\controller;
|
||
|
||
use app\common\model\MemberInfo as MemberInfoModel;
|
||
use app\common\service\Member as MemberService;
|
||
use app\common\service\Message as MessageService;
|
||
|
||
class Qrcode extends Center
|
||
{
|
||
|
||
public function index()
|
||
{
|
||
if (UID == $this->shareUser['uid']) {
|
||
$this->info = $this->user->info;
|
||
} else {
|
||
$this->info = $this->shareUser;
|
||
$user = MemberInfoModel::where('uid', $this->shareUser['uid'])->find();
|
||
$user->setInc('click');
|
||
}
|
||
return $this->fetch();
|
||
}
|
||
|
||
/**
|
||
* 留言
|
||
* @param string $uid [description]
|
||
* @return [type] [description]
|
||
*/
|
||
public function comment($uid = '')
|
||
{
|
||
if (IS_POST) {
|
||
$data = $this->request->post();
|
||
$res = MessageService::send($data, UID);
|
||
return $this->back($res);
|
||
} else {
|
||
$this->list = MessageService::getList($uid);
|
||
return $this->fetch();
|
||
}
|
||
}
|
||
|
||
// 点赞
|
||
public function tags($uid)
|
||
{
|
||
$res = MessageService::tags($uid);
|
||
if ($res === true) {
|
||
return $this->success();
|
||
} else {
|
||
return $this->error($res);
|
||
}
|
||
}
|
||
|
||
// 写签名
|
||
public function signature()
|
||
{
|
||
$signature = $this->request->post('signature');
|
||
$res = MemberService::editInfo(UID, ['signature' => $signature], 'signature');
|
||
if ($res === true) {
|
||
return $this->success('添加成功');
|
||
} else {
|
||
return $this->error($res);
|
||
}
|
||
}
|
||
|
||
//删除
|
||
public function del($id)
|
||
{
|
||
$res = MessageService::del($id);
|
||
return $this->back($res);
|
||
}
|
||
}
|