Commit bc6bbecc authored by wwccw0591's avatar wwccw0591

pc

parent 585fc2c4
<?php
class ShareController extends \Our\Controller_AbstractIndex {
public $memberId;
public function createIndexAction()
{
$shareService =\Business\User\ShareServiceModel::getInstance();
$saveData= $shareService->getSaveData($this->req['data']);
$shareService->saveDataToSession($saveData);
$res=$shareService->excuteCommand($this->key);
$this->success($res);
}
}
...@@ -151,6 +151,8 @@ class NameConst { ...@@ -151,6 +151,8 @@ class NameConst {
const leftBracket = '['; const leftBracket = '[';
const rightBracket = ']'; const rightBracket = ']';
const elasticName='elastic.master'; const elasticName='elastic.master';
const searchDbName='qmcs';
} }
?> ?>
\ No newline at end of file
...@@ -392,6 +392,8 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -392,6 +392,8 @@ class RefundServiceModel extends \Business\AbstractModel
$refundArrayUnLine=Common::convertUnderline($refundArray); $refundArrayUnLine=Common::convertUnderline($refundArray);
$state = $refundReturnDao->addRefundReturn($refundArray,$orderInfo,$orderGoods); $state = $refundReturnDao->addRefundReturn($refundArray,$orderInfo,$orderGoods);
if ($state) { if ($state) {
$orderDao->deleteOrderCache($memberId,$refund['orderId']);
$refundReturnDao->deleteRefundCache($memberId);
$refundStateName=$refundReturnDao->getRefundTextStatus($refundArrayUnLine); $refundStateName=$refundReturnDao->getRefundTextStatus($refundArrayUnLine);
$orderGoodsDao->update(array('rec_id'=>$orderGoods['recId']),array('refund_state_name'=>$refundStateName,'refund_id'=>$state)); $orderGoodsDao->update(array('rec_id'=>$orderGoods['recId']),array('refund_state_name'=>$refundStateName,'refund_id'=>$state));
$orderLogDao->addRefundOrderLog($orderInfo['orderId'],$refundArray['refund_type'],DescribeConst::buyer,$orderInfo['buyerName'],$orderInfo['orderState']); $orderLogDao->addRefundOrderLog($orderInfo['orderId'],$refundArray['refund_type'],DescribeConst::buyer,$orderInfo['buyerName'],$orderInfo['orderState']);
......
This diff is collapsed.
<?php <?php
namespace DAO; namespace Elasticsearch;
use Elasticsearch\ClientBuilder; use Elasticsearch\ClientBuilder;
use Error\CodeConfigModel; use Error\CodeConfigModel;
use Error\ErrorModel; use Error\ErrorModel;
...@@ -50,9 +50,99 @@ class ElasticsTool{ ...@@ -50,9 +50,99 @@ class ElasticsTool{
'index'=>$this->dbName, 'index'=>$this->dbName,
]; ];
$r=$this->client->indices()->create($indexParams); $r=$this->client->indices()->create($indexParams);
return $r;
}catch(\Exception $e){ }catch(\Exception $e){
ErrorModel::throwException(CodeConfigModel::elasticsError); ErrorModel::throwException(CodeConfigModel::elasticsError);
} }
} }
// public function create_index()
// {
// $indexParams['index'] = 'my_index';
// $indexParams['type'] = 'my_index';
// $indexParams['body']['settings']['number_of_shards'] = 2;
// $indexParams['body']['settings']['number_of_replicas'] = 0;
// $this->client->create($indexParams);
// }
public function add_document()
{
$params = array();
$params['body'] = array(
'testField' => 'dfdsfdsf'
);
$params['index'] = 'my_index';
$params['type'] = 'my_index';
$params['id'] = 'w1231313';
$ret = $this->client->index($params);
}
public function delete_index()
{
$deleteParams['index'] = 'my_index';
$this->client->indices()->delete($deleteParams);
}
public function deleteDocumentById($docId)
{
$deleteParams = array();
$deleteParams['index'] = $this->dbName;
$deleteParams['type'] = $this->tbName;
$deleteParams['id'] =$docId;
$retDelete = $this->client->delete($deleteParams);
return $retDelete;
}
public function update_document()
{
$updateParams = array();
$updateParams['index'] = 'my_index';
$updateParams['type'] = 'my_index';
$updateParams['id'] = 'my_id';
$updateParams['body']['doc']['asas'] = '111111';
$response = $this->client->update($updateParams);
}
public function search()
{
$searchParams['index'] = 'my_index';
$searchParams['type'] = 'my_index';
$searchParams['from'] = 0;
$searchParams['size'] = 100;
$searchParams['sort'] = array(
'_score' => array(
'order' => 'desc'
)
);
// $searchParams['body']['query']['match']['testField'] = 'abc';
$retDoc = $this->client->search($searchParams);
print_r($retDoc);
}
public function get_document()
{
$getParams = array();
$getParams['index'] = 'my_index';
$getParams['type'] = 'my_index';
$getParams['id'] = 'AU4Kn-knWOmOrmyOj2qg';
$retDoc = $this->client->get($getParams);
print_r($retDoc);
}
/**
* 类实例
*
* @var \DAO\UserModel
*/
private static $_instance = null;
/**
* 单例模式获取类实例
*
*/
public static function getInstance($type,$index=NameConst::searchDbName)
{
if (!(self::$_instance instanceof self)) {
self::$_instance = new self($index,$type);
}
return self::$_instance;
}
} }
\ No newline at end of file
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