Commit ec29aba1 authored by wwccw0591's avatar wwccw0591

pc

parent c644aa8f
......@@ -52,34 +52,35 @@ class IndexController extends \Our\Controller_Abstract {
}
public function indexAction() {
echo 1;exit;
$orderDao = \DAO\Order\OrderModel::getInstance();
$res=$orderDao->getList(array('buyer_id'=>1),'*',0,10);
echo json_encode($res);exit;
//$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsBrowserRedisModel::getInstance(),array(&$browseDAO, 'getDistinctDate'),array($memberId,$startTime,$endTime,$order),\Our\ApiConst::twoMinSecond,array($memberId));
//// echo 1;exit;
//// $orderDao = \DAO\Order\OrderModel::getInstance();
////
//// $res=$orderDao->getList(array('buyer_id'=>1),'*',0,10);
//// echo json_encode($res);exit;
//// //$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsBrowserRedisModel::getInstance(),array(&$browseDAO, 'getDistinctDate'),array($memberId,$startTime,$endTime,$order),\Our\ApiConst::twoMinSecond,array($memberId));
// $clientPush=\JPush\ClientPush::getInstance();
// $clientPush->pushAll();
$mongoDb= new \Mongo\MongoDbModel();
$res= $mongoDb->insert('message_history',array('id'=>1,'name'=>'chenchuanwen'));
echo json_encode($res);
exit;
\Our\Log::getInstance()->write('testLog|||||testLog');
var_dump($_SERVER);exit;
// echo $_SERVER['USER']);exit;
$elasticConfig=\Our\Common::getConfig('elastic.master');
$configArray=array(
$elasticConfig->host.':'.$elasticConfig->port,
);
$client=\Elasticsearch\ClientBuilder::create()->setHosts($configArray)->build();
$res=array(
'id'=>'nignx-log*',
'index'=>'.kibana',
'type'=>'index-pattern'
);
$res=$client->getSource($res);
echo json_encode($res);
exit;
// exit;
// $mongoDb= new \Mongo\MongoDbModel();
// $res= $mongoDb->insert('message_history',array('id'=>1,'name'=>'chenchuanwen'));
// echo json_encode($res);
// exit;
// \Our\Log::getInstance()->write('testLog|||||testLog');
// var_dump($_SERVER);exit;
// // echo $_SERVER['USER']);exit;
// $elasticConfig=\Our\Common::getConfig('elastic.master');
// $configArray=array(
// $elasticConfig->host.':'.$elasticConfig->port,
// );
// $client=\Elasticsearch\ClientBuilder::create()->setHosts($configArray)->build();
// $res=array(
// 'id'=>'nignx-log*',
// 'index'=>'.kibana',
// 'type'=>'index-pattern'
// );
// $res=$client->getSource($res);
// echo json_encode($res);
// exit;
}
public function check(){
......
......@@ -58,6 +58,20 @@ class MessageController extends \Our\Controller_AbstractApi {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::removeMessage);
}
}
/**
* 更新webim消息
*
* @ccw
*/
public function removeAllAction(){
$messageService = \Business\Message\MessageServiceModel::getInstance();
$res=$messageService->update($this->memberId,$this->req['data']['fromType'],$this->req['data']['toId'],$this->req['data']['toType']);
if($res!==false){
$this->success($res,'删除成功');
}else{
\Error\ErrorModel::throwException(\Error\CodeConfigModel::removeMessage);
}
}
/**
* 更新webim消息
*
......
......@@ -296,7 +296,25 @@ class MessageServiceModel extends \Business\AbstractModel
}
return $isSuccess;
}
/**
* 删除用户消息
*
* @ccw
*/
public function removeAll($memberId, $fromType,$toId,$toType)
{
$memageHistoryDao = \DAO\MessageHistoryModel::getInstance();
$where=Common::format(" (fromId={0} and fromType={1} and toId={2} and toType={3} and isDel={4}) or (fromId={2} and fromType={3} and toId={0} and toType={1} and idDel={5})",$memberId,$fromType,$toId,$toType,ApiConst::sendRemove);
$data['isDel']=ApiConst::remove;
$memageHistoryDao->updateByWhere($where,$data);
$where=Common::format(" fromId={0} and fromType={1} and toId={2} and toType={3} and isDel={4}",$memberId,$fromType,$toId,$toType,ApiConst::zero);
$data['isDel']=ApiConst::sendRemove;
$memageHistoryDao->updateByWhere($where,$data);
$where=Common::format(" fromId={2} and fromType={3} and toId={0} and toType={1} and isDel={4}",$memberId,$fromType,$toId,$toType,ApiConst::zero);
$data['isDel']=ApiConst::recieveRemove;
$memageHistoryDao->updateByWhere($where,$data);
return true;
}
/**
* 获得消息按钮
*
......
Send POST https://api.jpush.cn/v3/push, body:{"platform":"all","audience":"all","notification":{"alert":"Hi, JPush"},"options":{"sendno":1913510038,"apns_production":false}}, times:1
Send POST https://api.jpush.cn/v3/push, body:{"platform":"all","audience":"all","notification":{"alert":"Hi, JPush"},"options":{"sendno":93988000,"apns_production":false}}, times:1
Send POST https://api.jpush.cn/v3/push, body:{"platform":"all","audience":"all","notification":{"alert":"Hi, JPush"},"options":{"sendno":54209,"apns_production":false}}, times:1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment