83 行
2.4 KiB
PHP
可执行文件
83 行
2.4 KiB
PHP
可执行文件
<?php
|
|
|
|
namespace Retail\Controller;
|
|
|
|
use Common\Model\RetailMerchantConfigModel;
|
|
use Common\Model\StoreConfigModel;
|
|
use Common\Model\WxappinfoModel;
|
|
use Think\Controller;
|
|
|
|
//[1.4.90]
|
|
class ShippingController extends BaseController
|
|
{
|
|
public function index()
|
|
{
|
|
$arr = array(
|
|
'index' => '/index.php/Retail/Shipping/index',
|
|
);
|
|
$authArr = checkFunction($arr);
|
|
$this->assign('authArr', $authArr);
|
|
$identity = session('identity');
|
|
$this->assign('identity', $identity);
|
|
$this->display();
|
|
}
|
|
|
|
/**
|
|
* 修改会员转化信息
|
|
*/
|
|
public function getBaseData()
|
|
{
|
|
$merchant_id = $this->merchant_id;
|
|
$MerchantConfigModel = D('RetailMerchantConfig');
|
|
$MerchantConfig = $MerchantConfigModel->getConfig($merchant_id);
|
|
if ($MerchantConfig) {
|
|
$res['status'] = 1;
|
|
$res['massage'] = '获取成功';
|
|
$res['vip_register_state'] = $MerchantConfig['vip_register_state'] == 1 ? 1 : 0;
|
|
$res['plus_register_state'] = $MerchantConfig['plus_register_state'] == 1 ? 1 : 0;
|
|
} else {
|
|
$res['status'] = 0;
|
|
$res['massage'] = '获取失败';
|
|
}
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 获取会员转化显示状态
|
|
*/
|
|
public function changeStatus()
|
|
{
|
|
$MerchantConfigModel = new RetailMerchantConfigModel();
|
|
$map = array(
|
|
'merchant_id' => $this->merchant_id
|
|
);
|
|
|
|
$vip_register_state = I('post.vip_register_state');
|
|
$plus_register_state = I('post.plus_register_state');
|
|
$field = array(
|
|
'vip_register_state' => $vip_register_state,
|
|
'plus_register_state' => $plus_register_state,
|
|
);
|
|
$data = $MerchantConfigModel->getFind($map);
|
|
if (empty($data)) {
|
|
$field['merchant_id'] = $this->merchant_id;
|
|
$MerchantConfig = $MerchantConfigModel->addOrder($field);
|
|
} else {
|
|
$MerchantConfig = $MerchantConfigModel->updateOrder($map, $field);
|
|
}
|
|
|
|
if ($MerchantConfig) {
|
|
$res = array(
|
|
'status' => 1,
|
|
'msg' => '修改成功',
|
|
);
|
|
} else {
|
|
$res = array(
|
|
'status' => 0,
|
|
'msg' => '修改失败',
|
|
);
|
|
}
|
|
$this->ajaxReturn($res);
|
|
}
|
|
}
|