Commit 99c21dd8 authored by zhz's avatar zhz

Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into master_dev

parents 76c66110 678db1bb
......@@ -26,6 +26,26 @@ class AuthinfoController extends \Our\Controller_Abstract
$name = $this->req->getQuery('name');
throw new Exception('hello ', 404);
}
public function otherLoginAction(){
$this->req=$this->getRequest()->getQuery();
$postData['key']=$this->req['key'];
$postData['authSign']=$this->req['authSign'];
if($postData['authSign']==md5($postData['key'].\Our\SecretKeys::authKey)){
session_id($postData['key']);
$this->sess=\Yaf\Session::getInstance();
$this->sess->start();
$memberId=$this->sess->get('member_id');
if(!empty($memberId)){
$this->sess->set('other_login',\Our\ApiConst::one);
}else{
}
}else{
}
\Yaf\Dispatcher::getInstance()->disableView();
}
public function testAction()
{
......
<?php
class SearchController extends \Our\Controller_AbstractIndex {
public $memberId;
public function createIndexAction()
{
$serchService=\Business\Search\SearchServiceModel::getInstance();
$res=$serchService->createShopKeeperOrders();
$this->success($res);
}
public function createIkIndexAction()
{
$serchService=\Business\Search\SearchServiceModel::getInstance();
$res=$serchService->createShopKeeperIkOrders();
$this->success($res);
}
public function insertRowAction()
{
$serchService=\Business\Search\SearchServiceModel::getInstance();
$res=$serchService->insertRows();
$this->success($res);
}
public function searchAction()
{
$serchService=\Business\Search\SearchServiceModel::getInstance();
$res=$serchService->searchRows();
$this->success($res);
}
}
......@@ -14,11 +14,18 @@ class UserController extends \Our\Controller_AbstractIndex {
}
public function indexAction() {
private function indexAction() {
$login=LoginV2Model::getInstance();
echo $login->login();
}
private function updateOldLoginKey($token){
$params['authSign']=md5($token.\Our\SecretKeys::authKey);
$params['key']=$token;
$paramsStr=http_build_query($params);
$domain= Bootstrap::getUrlIniConfig('resourcesHost');
$getUrl=$domain.\Our\PathConst::authInfoOtherLogin.'?'.$paramsStr;
file_get_contents($getUrl);
}
/**
* 用户登录
*
......@@ -41,12 +48,15 @@ class UserController extends \Our\Controller_AbstractIndex {
if(!$result['status']){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::loginBindUserInfoFailed);
}
if(isset($result['member'])&&$member){
if(isset($result['member'])&&$member){
$member = array_merge($member,$result['member']);
}
}
$userToken=$this->memberService->findMbUserTokenByMemberId($member['member_id']);
$this->memberService->clearKey($userToken['token']);
if(!empty($userToken['token'])){
$this->updateOldLoginKey($userToken['token']);
//$this->memberService->clearKey($userToken['token']);
}
if($member){
$this->memberService->clearKey($this->key);
$this->key=Common::bulidToken($mobile,$password);
......@@ -129,6 +139,7 @@ class UserController extends \Our\Controller_AbstractIndex {
$this->sess['user_type'] = $where['userType'];
$this->sess[NameConst::sessionKey]=$this->key;
$member[NameConst::sessionKey]=$this->key;
$member['login_time']=TIMESTAMP;
$this->memberService->saveMember($member);
$this->success(array('userFlag'=>\Our\ApiConst::one,'key'=>$this->key,'memberName'=>$member['member_name'],'memberAvatar'=>$member['memberAvatarUrl']));
}else{
......
......@@ -445,12 +445,14 @@ class OrderConfirmUtil {
$orderGoods['goods_group'] = serialize($storeCart['goodsList']);
$orderGoods['goods_price'] = $storeCart['goodsPrice'];
$orderGoods['goods_commonid'] = \Our\ApiConst::zero;
$orderGoods['goods_spec'] = '';
}else{
$orderGoods['goods_price'] = \Goods\GoodsUtil::getInstance()->getRealPrice($storeCart['goodsId'],$this->memberId);
$orderGoods['goods_commonid'] = $storeCart['goodsCommonId'];
if($orderGoods['sale_act_id']&&$orderGoods['sale_id']){//当前商品有参与销售活动结算时
$this->saleGoodsIds[] = $storeCart['goodsId'];
}
$orderGoods['goods_group'] = '';
}
$orderGoods['gmt_create'] = TIMESTAMP;
......
......@@ -14,13 +14,13 @@ class AdvConst {
const advPositionHomeTop = 1050; //首页头部广告位
const advPositionHomeMiddle = 1050; //首页中部广告位
const advPositionHomeMiddle = 1052; //首页中部广告位
const advPositionPopUp = 1050; //平台首页弹窗广告
const advIntervalSecond = 2000; //广告位默认轮播时间间隔,单位毫秒
const advPositionClassTop = 1050; //平台一级分类广告
const advPositionClassTop = 1053; //平台一级分类广告
const advEmptyCart = 1051; //购物车为空时广告位
......
......@@ -11,7 +11,8 @@ class ApiConst
const randLengh = 8;
//10天数秒
const tenDaySecond = 864000;
// const tenDaySecond = 864000;
const tenDaySecond = 300;
//一天
const oneDaySecond = 86400;
//半天
......@@ -131,6 +132,8 @@ class ApiConst
const refundSellerAgree = 2;
const refundSellerRefuse = 3;
const refundTypeGoods = 2;
const returnTypeNotReturn=1;
const returnTypeMustReturn=2;
const refundTypeMoney = 1;
const refundApplyOnlyMoney = 1;
......
<?php
namespace Our;
use Business\User\MemberServiceModel;
use Error\CodeConfigModel;
use Error\ErrorModel;
/**
......@@ -33,6 +34,11 @@ abstract class Controller_AbstractApi extends \Our\Controller_Abstract {
if(empty($this->memberId)){
ErrorModel::throwException(CodeConfigModel::noLogin);
}
if(isset($sess['other_login']) && $sess['other_login']==ApiConst::one){
$memberService=MemberServiceModel::getInstance();
$memberService->clearKey($this->req['data']['key']);
ErrorModel::throwException(CodeConfigModel::otherDriverLogin);
}
\Yaf\Dispatcher::getInstance()->disableView();
}
public function getAuthKey(){
......
......@@ -151,6 +151,8 @@ class NameConst {
const leftBracket = '[';
const rightBracket = ']';
const elasticName='elastic.master';
const shopkeeper='shopkeeper';
}
?>
\ No newline at end of file
......@@ -39,6 +39,8 @@ class PathConst {
const orderConfirmTaskAddTime="/orderConfirmTaskAddTime.conf";
const orderId="orderId={0}";
const authInfoOtherLogin="/authInfo/otherLogin";
//const favoritesStoreFavTimeConf="favoritesStoreFavTime.conf";
......
......@@ -443,7 +443,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$return = $FavoritesInstance->insertOrUpdate(array('member_id'=>$memberId,'goods_commonid'=>$goodsCommonId,'fav_time'=>time()));
if((int)$return > 0){
//删除缓存
\Our\RedisHelper::delCachedFunction(\Redis\Db4\FavoritesRedisModel::getInstance(),array(&$FavoritesInstance, 'getOne'),array('*',array('goods_commonid'=>$goodsCommonId,'member_id'=>$memberId)),array($memberId));
\Our\RedisHelper::delCachedFunction(\Redis\Db4\FavoritesRedisModel::getInstance(),array(&$FavoritesInstance, 'getOne'),array('*',array('member_id'=>$memberId,'goods_commonid'=>$goodsCommonId)),array($memberId));
\Our\RedisHelper::delCachedFunction(\Redis\Db4\FavoritesRedisModel::getInstance(),array(&$FavoritesInstance, 'getList'),array(),array($memberId));
//更新个人中心首页数量
\DAO\MemberModel::getInstance()->_changeNum(\Our\NameConst::goodsCollection,$memberId);
......
......@@ -565,6 +565,7 @@ class OrderServiceModel extends \Business\AbstractModel
//商店相关信息
$this->store = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$storeDao, 'getInfoById'), array($this->order['storeId'], $this->storeField), \Our\ApiConst::oneDaySecond);
$orderGoods=$goodsDao->convert($this->orderGoodsList);
if(empty($orderGoods)){
$orderGoods=array();
}
......@@ -581,8 +582,11 @@ class OrderServiceModel extends \Business\AbstractModel
'reciverName' => $this->orderCommon['reciverName'],
'mobPhone' => $reciverInfo['mob_phone'],
'street' => $reciverInfo['street'],
'lng'=>isset($reciverInfo['lng'])?$reciverInfo['lng']:ApiConst::zero,
'lat'=>isset($reciverInfo['lat'])?$reciverInfo['lat']:ApiConst::zero,
'subAddress' => isset($reciverInfo['sub_address']) ? $reciverInfo['sub_address'] : '',
'orderGoods' => $orderGoods,
'shippingFee'=>$this->order['shippingFee'],
);
return $returnData;
......
......@@ -22,7 +22,7 @@ use Our\ImageUtil;
class RefundServiceModel extends \Business\AbstractModel
{
private $orderField = "buyer_id as buyerId,buyer_name as buyerName,order_id as orderId,order_sn as orderSn,store_name as storeName,add_time as AddTime,store_id as storeId,goods_amount as goodsAmount,shipping_fee as shippingFee,order_amount as orderAmount,shipping_type as shippingType,payment_type as paymentType,order_state as orderState,shipping_fee as shippingFee,refund_state as refundState,order_type as orderType,is_receive_payment as isReceivePayment,need_shipping_fee as needShippingFee,payment_code as paymentCode,delay_time as delayTime";
private $orderGoodsField = "commis_rate as commisRate,goods_type as goodsType,order_id as orderId,rec_id as recId,goods_id as goodsId,goods_name as goodsName,goods_price as goodsPrice,goods_num as goodsNum,goods_image as goodsImage,goods_pay_price as goodsPayPrice,sale_act_id as saleActId,sale_id as saleId,comment_state as commentState,is_refund as isRefund,goods_spec as goodsSpec,goods_group as goodsGroup";
private $orderGoodsField = "commis_rate as commisRate,goods_type as goodsType,order_id as orderId,rec_id as recId,goods_id as goodsId,goods_name as goodsName,goods_price as goodsPrice,goods_num as goodsNum,goods_image as goodsImage,goods_pay_price as goodsPayPrice,sale_act_id as saleActId,sale_id as saleId,comment_state as commentState,is_refund as isRefund,goods_spec as goodsSpec,goods_group as goodsGroup,refund_id as refundId";
private $addressField = " mob_phone as MobPhone,tel_phone as TelPhone,address as address,area_info as areaInfo,lng,lat,address_id as addressId,subaddress as subAddress";
private $daddressField = "address_id as addressId,store_id as storeId,seller_name as sellerName,area_id as areaId,city_id as cityId,area_info as areaInfo,address,telphone,company,is_store_address as isStoreAddress,is_default as isDefault";
......@@ -337,6 +337,12 @@ class RefundServiceModel extends \Business\AbstractModel
$orderGoodsDao = \DAO\Order\OrderGoodsModel::getInstance(DbNameConst::masterDBConnectName);
$orderLogDao = \DAO\Order\OrderLogModel::getInstance(DbNameConst::masterDBConnectName);
$orderGoods = $orderGoodsDao->getOneByOrderIdAndGoodsId($refund['orderId'], $refund['goodsId'], $this->orderGoodsField);
if(empty($orderGoods)){
ErrorModel::throwException(CodeConfigModel::notExistOrderGoods);
}
if($orderGoods['refundId']>ApiConst::zero){
ErrorModel::throwException(CodeConfigModel::alreadyExsitRefundGoods);
}
$refundAmount = $refund['refundAmount'];//退款金额
if ($orderInfo['paymentTime']) {
if (($refundAmount < ApiConst::zero) || ($refundAmount > $orderGoods['goodsPayPrice'])) {
......@@ -392,6 +398,8 @@ class RefundServiceModel extends \Business\AbstractModel
$refundArrayUnLine=Common::convertUnderline($refundArray);
$state = $refundReturnDao->addRefundReturn($refundArray,$orderInfo,$orderGoods);
if ($state) {
$orderDao->deleteOrderCache($memberId,$refund['orderId']);
$refundReturnDao->deleteRefundCache($memberId);
$refundStateName=$refundReturnDao->getRefundTextStatus($refundArrayUnLine);
$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']);
......@@ -446,20 +454,24 @@ class RefundServiceModel extends \Business\AbstractModel
$info['canPlatformIn'] = $refundReturnDao->isPlatformIn($info) ? ApiConst::one : ApiConst::zero;
$info['canSendShippingType'] = $refundReturnDao->checkIsAddReturnShipping($info) ? ApiConst::one : ApiConst::zero;
if($info['refundShippingType']==ApiConst::bySeller){
if(!$info['diliverymanId']){
$info['diliveryman']=ArrayConst::defaultDeliveryMan;
}else{
$diliveryMan=$diliveryManDao->findById($info['diliverymanId']);
if(!empty($diliveryMan)){
$diliveryMan=array(
'id'=>$diliveryMan['id'],
'trueName'=>$diliveryMan['true_name'],
'mobile'=>$diliveryMan['mobile'],
);
$info['diliveryman']=$diliveryMan;
if($info['returnType']==ApiConst::returnTypeMustReturn){
if(!$info['diliverymanId']){
$info['diliveryman']=ArrayConst::defaultDeliveryMan;
}else{
$info['diliveryman']=new \stdClass();
$diliveryMan=$diliveryManDao->findById($info['diliverymanId']);
if(!empty($diliveryMan)){
$diliveryMan=array(
'id'=>$diliveryMan['id'],
'trueName'=>$diliveryMan['true_name'],
'mobile'=>$diliveryMan['mobile'],
);
$info['diliveryman']=$diliveryMan;
}else{
$info['diliveryman']=new \stdClass();
}
}
}else{
$info['diliveryman']=new \stdClass();
}
}else{
$info['diliveryman']=new \stdClass();
......
<?php
namespace Business\Search;
/**
* 店铺service
*
* @date 2018-5-15
* @author zhz
*/
class SearchServiceModel extends \Business\AbstractModel
{
public function init()
{
}
public function createShopKeeperOrders()
{
$elasticsToolElasticssearch=\Elastics\ElasticsToolModel::getInstance('orders');
$res=$elasticsToolElasticssearch->createIndexDetail();
return $res;
}
public function createShopKeeperIkOrders()
{
$elasticsToolElasticssearch=\Elastics\ElasticsToolModel::getInstance('orders');
$delRes=$elasticsToolElasticssearch->deleteIndex();
$createRes=$elasticsToolElasticssearch->createIkField();
$postData=array(
['goodsName'=>""闺蜜"崔顺实被韩检方传唤 韩总统府促彻查真相"],
['goodsName'=>"韩举行"护国训练" 青瓦台:决不许国家安全出问题"],
['goodsName'=>"韩举行"护国训练" 青瓦台:决不许国家安全出问题"],
['goodsName'=>"媒体称FBI已经取得搜查令 检视希拉里电邮"],
['goodsName'=>"村上春树获安徒生奖 演讲中谈及欧洲排外问题"],
['goodsName'=>"希拉里团队炮轰FBI 参院民主党领袖批其“违法”"],
);
$res=$elasticsToolElasticssearch->postBulkDoc($postData);
return $res;
}
public function insertRows()
{
$elasticsToolElasticssearch=\Elastics\ElasticsToolModel::getInstance('orders');
$row=array(
'name'=>'陈传文',
'age'=>46,
'sex'=>'男',
);
$res=$elasticsToolElasticssearch->createDocument($row);
return $res;
}
public function searchRows(){
$elasticsToolElasticssearch=\Elastics\ElasticsToolModel::getInstance('orders');
$query=array(
'goodsName'=>'希拉里和韩国',
);
$res=$elasticsToolElasticssearch->searchMatch($query);
return $res;
}
/**
* 类实例
*
* @var \DAO\UserModel
*/
private static $_instance = null;
/**
* 单例模式获取类实例
*
*/
public static function getInstance()
{
if (!(self::$_instance instanceof self)) {
self::$_instance = new self();
}
return self::$_instance;
}
}
......@@ -57,7 +57,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$storeTodayStats = $storeStatisticsDayDao->getById($storeId);
$data['storeId'] = $store['store_id'];
$data['storeName'] = $store['store_name'];
$data['storeLable'] = $store['store_label'];
$data['storeLabel'] = $store['store_label'];
$data['goodsCount'] = isset($storeStats['goodsCount']) ? $storeStats['goodsCount'] : ApiConst::zero;
$data['orderCount'] = isset($storeStats['orderCount']) ? $storeStats['orderCount'] : ApiConst::zero;
$data['orderTotal'] = isset($storeStats['orderTotal']) ? $storeStats['orderTotal'] : ApiConst::zero;
......
......@@ -102,11 +102,11 @@ class AddressServiceModel extends \Business\AbstractModel {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::addressNotExist);
}
$sess = \Yaf\Session::getInstance();
$newAddress['addressId'] = $address['address_id'];
$newAddress['addressId'] = $address['addressId'];
$newAddress['address'] = $address['address'];
$newAddress['tagType'] = $address['tag_type'];
$newAddress['tagType'] = $address['tagType'];
$returnAddresses[] = $newAddress;
$choosedAddressId = $address['address_id'];
$choosedAddressId = $address['addressId'];
$newAddress = $address;
$newAddress['lng'] = $address['lng'];
$newAddress['lat'] = $address['lat'];
......@@ -265,7 +265,6 @@ class AddressServiceModel extends \Business\AbstractModel {
* @throws \Exception
*/
public function getMyAddress($where,$memberId){
$addressDao = \DAO\AddressModel::getInstance();
$columns = $addressDao->getAddressColumns();
if($where['addressId']){
......@@ -277,7 +276,7 @@ class AddressServiceModel extends \Business\AbstractModel {
if(!$address||($address&&$address['member_id']!=$memberId)){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::addressNotExist);
}
}
};
if($address){
$address = \Our\Common::convertUnderline($address);
$address['subAddress'] = $address['subaddress'];
......
......@@ -4,6 +4,7 @@ namespace Business\User;
use DAO\MbUserTokenModel;
use DAO\MemberModel;
use DAO\SaleMemberModel;
use Error\CodeConfigModel;
use Error\ErrorModel;
use Our\ApiConst;
......@@ -285,7 +286,19 @@ class MemberServiceModel extends \Business\AbstractModel
}
$scan_sale_ids = $sess->get('scan_sale_ids');
if($scan_sale_ids){
\DAO\SaleModel::getInstance()->getList(array('sale_id'=>array('in',$scan_sale_ids)),'sale_act_id,member_id');
$saleIds = array_keys($scan_sale_ids);
$saleList = \DAO\SaleModel::getInstance()->getList(array('sale_id'=>array('in',$saleIds)),'sale_id,sale_act_id,member_id');
$saleMembers = array();
foreach($saleList as $sale){
$saleMember = array();
$saleMember['member_id'] = $memberId;
$saleMember['store_id'] = $scan_sale_ids[$sale['sale_id']];
$saleMember['sale_id'] = $sale['member_id'];
$saleMember['sale_act_id'] = $sale['sale_act_id'];
$saleMembers[]=$saleMember;
}
$resultSaleMember = \DAO\SaleMemberModel::getInstance()->insertAllOrUpdate($saleMembers);
return $resultSaleMember;
}
return true;
}
......
......@@ -36,7 +36,7 @@ class ShareServiceModel extends \Business\AbstractModel
$data['driverType'] = $driverType;
$data['qrCode']=$this->growQrcode($data);
if($data['type']==ApiConst::shareStore){
$storeDao=\DAO\StoreMemberModel::getInstance(DbNameConst::salveDBConnectName);
$storeDao=\DAO\StoreModel::getInstance(DbNameConst::salveDBConnectName);
$data['address']=$storeDao->getAddress($data['id']);
}
// $data['qrCode']=\Our\RedisHelper::cachedFunction(\Redis\Db0\MemberRedisModel::getInstance(), array(&$this, 'growQrcode'), array($data));
......
......@@ -329,8 +329,8 @@ class GoodsModel extends \DAO\AbstractModel {
public function getFormatGoodsAttr($goodsSpecStr){
$goodsAttr = array();
if(!empty($goodsSpecStr)){
if(CommonExtension::isSerialized($goodsSpecStr)){
$goodsSpec = unserialize($goodsSpecStr);
$goodsSpec = unserialize($goodsSpecStr);
if($goodsSpec){
if (is_array($goodsSpec) && count($goodsSpec) > 0) {
$goodsAttr = array();
foreach ($goodsSpec as $key => $value) {
......@@ -340,7 +340,6 @@ class GoodsModel extends \DAO\AbstractModel {
}
}
}
}
return $goodsAttr;
}
......@@ -364,9 +363,12 @@ class GoodsModel extends \DAO\AbstractModel {
public function getGoodsGroup($goodsGroup){
$orderGoodses=array();
if(!empty($goodsGroup)){
$goodsGroup=unserialize($goodsGroup);;
$goodsGroup=unserialize($goodsGroup);
$goodsGroup=json_decode(json_encode($goodsGroup),true);
foreach($goodsGroup as $orderGoods){
unset($orderGoods['goodsSpec']);
if(isset($orderGoods['goodsSpec'])){
unset($orderGoods['goodsSpec']);
}
$orderGoods['goodsImage']=\Our\ImageUtil::getGoodsImgUrl($orderGoods['goodsImagePath'],\Our\ImageConst::goods);
unset($orderGoods['goodsImagePath']);
array_push($orderGoodses,$orderGoods);
......
......@@ -102,7 +102,6 @@ class MemberModel extends \DAO\AbstractModel
$this->setDb(\Our\DbNameConst::masterDBConnectName);
$result = $this->db->update($this->_tableName)->rows($data)->where(array('member_id' => $memberId))->execute();
if ($result) {
$memberDb0Redis = \Redis\Db0\MemberRedisModel::getInstance();
$member = $data;
if (isset($member['member_avatar']) && $member['member_avatar']) {
......
......@@ -168,10 +168,10 @@ class OrderGoodsModel extends \DAO\AbstractModel {
public function insertAll($datas){
$this->setDb(\Our\DbNameConst::masterDBConnectName);
$error = 0;
$baseSql = "insert IGNORE into {$this->_tableName}(order_id,store_id,goods_id,goods_name,goods_num,goods_image,goods_price,goods_pay_price,buyer_id,snapshot_id,goods_spec,goods_commonid,gc_id,gc_id_1,gc_id_2,gc_id_3,gmt_create,gmt_update,sale_act_id,sale_id) values";
$baseSql = "insert IGNORE into {$this->_tableName}(order_id,store_id,goods_id,goods_name,goods_num,goods_image,goods_price,goods_pay_price,buyer_id,snapshot_id,goods_spec,goods_commonid,gc_id,gc_id_1,gc_id_2,gc_id_3,gmt_create,gmt_update,sale_act_id,sale_id,goods_group) values";
$insertAllSql = $baseSql;
for ($i = 0; $i < count($datas); $i++) {
$addSql = \Our\Common::format("('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}'),", $datas[$i]['order_id'], $datas[$i]['store_id'], $datas[$i]['goods_id'], $datas[$i]['goods_name'], $datas[$i]['goods_num'], $datas[$i]['goods_image'], $datas[$i]['goods_price'], $datas[$i]['goods_pay_price'], $datas[$i]['buyer_id'], $datas[$i]['snapshot_id'], $datas[$i]['goods_spec'], $datas[$i]['goods_commonid'], $datas[$i]['gc_id'], $datas[$i]['gc_id_1'], $datas[$i]['gc_id_2'], $datas[$i]['gc_id_3'], $datas[$i]['gmt_create'], $datas[$i]['gmt_update'], $datas[$i]['sale_act_id'], $datas[$i]['sale_id']);
$addSql = \Our\Common::format("('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}'),", $datas[$i]['order_id'], $datas[$i]['store_id'], $datas[$i]['goods_id'], $datas[$i]['goods_name'], $datas[$i]['goods_num'], $datas[$i]['goods_image'], $datas[$i]['goods_price'], $datas[$i]['goods_pay_price'], $datas[$i]['buyer_id'], $datas[$i]['snapshot_id'], $datas[$i]['goods_spec'], $datas[$i]['goods_commonid'], $datas[$i]['gc_id'], $datas[$i]['gc_id_1'], $datas[$i]['gc_id_2'], $datas[$i]['gc_id_3'], $datas[$i]['gmt_create'], $datas[$i]['gmt_update'], $datas[$i]['sale_act_id'], $datas[$i]['sale_id'],$datas[$i]['goods_group']);
$insertAllSql .= $addSql;
if ($i % 1000 == 0 && $i != 0) {
$insertAllSql = rtrim($insertAllSql, ',');
......
This diff is collapsed.
<?php
namespace DAO;
use Elasticsearch\ClientBuilder;
use Error\CodeConfigModel;
use Error\ErrorModel;
use Our\NameConst;
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/17
* Time: 15:11
*/
class ElasticsTool{
protected $dbName;
protected $tbName;
protected $client;
protected function __construct($dbName,$tbName)
{
$elasticConfig=\Our\Common::getConfig(NameConst::elasticName);
$configArray=array(
'host' => $elasticConfig->host,
'port' => $elasticConfig->port,
'scheme' => $elasticConfig->scheme
);
try{
$this->dbName=$dbName;
$this->tbName=$tbName;
$this->client =ClientBuilder::create()->setHosts($configArray)->build();
}catch(\Exception $e){
ErrorModel::throwException(CodeConfigModel::elasticsError);
}
}
protected function initParams(){
return [
'index'=>$this->dbName,
'type'=>$this->tbName
];
}
/*
* 陈传文
* 创建索引在设置mapping之前要创建索引
*
*
*
* */
public function createIndex(){
try{
$indexParams=[
'index'=>$this->dbName,
];
$r=$this->client->indices()->create($indexParams);
}catch(\Exception $e){
ErrorModel::throwException(CodeConfigModel::elasticsError);
}
}
}
\ No newline at end of file
......@@ -89,6 +89,7 @@ class CodeConfigModel {
const updateMobileMembmerFailed = 10076;
const updateMobileMembmerMappingFailed = 10077;
const currentMobileHasBeenBind = 10078;
const otherDriverLogin=10105;
//访问错误
const illegalAccess=200001;
......@@ -261,6 +262,7 @@ class CodeConfigModel {
const notExistOrderGoods=300110;
const notExsitDeliver=300111;
const notExsitOrder=300112;
const alreadyExsitRefundGoods=300113;
//店铺相关错误码
//商品分类
......@@ -652,6 +654,7 @@ class CodeConfigModel {
self::deliverError=>'快递跟踪失败,订单状态有误',
self::notExsitDeliver=>'配送单不存在',
self::notExsitOrder=>'订单不存在',
self::alreadyExsitRefundGoods=>'退款订单已经存在',
self::deleteError=>'放入回收站失败,订单状态有误',
self::restoreError=>'永久删除、从回收站还原失败,订单状态有误',
self::shareError=>'分享失败,订单状态有误',
......@@ -741,6 +744,7 @@ class CodeConfigModel {
self::updateMobileMembmerFailed => '更新手机号对应会员信息失败',
self::updateMobileMembmerMappingFailed => '更新手机号码对应会员mapping信息失败',
self::currentMobileHasBeenBind => '当前手机号码已经绑定其他微信,如需绑定,请先手机号码登录app进行微信解绑',
self::otherDriverLogin=>'当前用户已被其他设备登录,请重新登录',
self::elasticsError=>'全文索引连接出错'
);
}
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>简单的html5 File测试 for pic2base64</title>
<style>
</style>
</head>
<body>
<form action="/search/createIkIndex" method="post">
用户登录状态key:<input name="data[key]" value="52da049f7e2fbf0e10da32dfe909850e"/><br />
<p id="img_area"></p>
<input type="submit" value="提交">
</form>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>简单的html5 File测试 for pic2base64</title>
<style>
</style>
</head>
<body>
<form action="/search/createIndex" method="post">
用户登录状态key:<input name="data[key]" value="52da049f7e2fbf0e10da32dfe909850e"/><br />
<p id="img_area"></p>
<input type="submit" value="提交">
</form>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>简单的html5 File测试 for pic2base64</title>
<style>
</style>
</head>
<body>
<form action="/search/insertRow" method="post">
用户登录状态key:<input name="data[key]" value="52da049f7e2fbf0e10da32dfe909850e"/><br />
<p id="img_area"></p>
<input type="submit" value="提交">
</form>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>简单的html5 File测试 for pic2base64</title>
<style>
</style>
</head>
<body>
<form action="/search/search" method="post">
用户登录状态key:<input name="data[key]" value="52da049f7e2fbf0e10da32dfe909850e"/><br />
<p id="img_area"></p>
<input type="submit" value="提交">
</form>
</body>
</html>
\ No newline at end of file
......@@ -12,7 +12,7 @@
用户登录状态key:<input name="data[key]" value="ceb72deab920ac0edb7272b2ed9dfa1e"/><br />
配送订单id:<input name="data[id]" value="12"/><br />
配送订单id:<input name="data[debug]" value="1"/><br />
<p id="img_area"></p>
<input type="submit" value="提交">
</form>
......
This diff is collapsed.
......@@ -9,8 +9,8 @@
</head>
<body>
<form action="/order/getRefundDetail" method="post">
用户登录状态key:<input name="data[key]" value="ceb72deab920ac0edb7272b2ed9dfa1e"/><br />
退款refundId:<input name="data[refundId]" value="316574"/><br />
用户登录状态key:<input name="data[key]" value="52da049f7e2fbf0e10da32dfe909850e"/><br />
退款refundId:<input name="data[refundId]" value="8"/><br />
<p id="img_area"></p>
<input type="submit" value="提交">
</form>
......
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