Files
addons
app_download_files
extend
hyhproject
admin
app
common
home
behavior
common
conf
controller
model
Articles.php
Attributes.php
Base.php
Goods.php
GoodsVirtuals.php
HomeMenus.php
Imports.php
Reports.php
Settlements.php
ShopConfigs.php
ShopFreights.php
ShopRoles.php
ShopUsers.php
Shops.php
SpecItems.php
Users.php
validate
view
home2
mobile2
wechat2
.htaccess
command.php
mobile
oss
static
thinkphp
upload
vendor
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5B854518.wgt
admin.php
app-release.apk
app_download.html
cash.lock
demo.php
get_startup.php
get_version.php
get_version_new.php
hyhproject.tar.gz
index.html
index.php
reg.lock
robots.txt
qlg.tsgz.moe/hyhproject/home/model/ShopConfigs.php
2019-09-06 23:53:10 +08:00

63 lines
2.1 KiB
PHP
Executable File

<?php
namespace wstmart\home\model;
/**
* ============================================================================
* 门店配置类
*/
use think\Db;
class ShopConfigs extends Base{
/**
* 店铺设置
*/
public function getShopCfg($id){
$rs = $this->where("shopId=".$id)->find();
if($rs != ''){
//图片
$rs['shopAds'] = ($rs['shopAds']!='')?explode(',',$rs['shopAds']):null;
//图片的广告地址
$rs['shopAdsUrl'] = ($rs['shopAdsUrl']!='')?explode(',',$rs['shopAdsUrl']):null;
return $rs;
}
}
/**
* 修改店铺设置
*/
public function editShopCfg($shopId){
$data = input('post.');
//加载商店信息
Db::startTrans();
try{
$shopcg = $this->where('shopId='.$shopId)->find();
$scdata = array();
$scdata["shopKeywords"] = Input("shopKeywords");
$scdata["shopBanner"] = Input("shopBanner");
$scdata["shopDesc"] = Input("shopDesc");
$scdata["shopAds"] = Input("shopAds");
$scdata["shopAdsUrl"] = Input("shopAdsUrl");
$scdata["shopHotWords"] = Input("shopHotWords");
$scdata["shopStreetImg"] = Input("shopStreetImg");
WSTUseImages(0, $shopcg['configId'], $scdata['shopStreetImg'],'shop_configs','shopStreetImg');
WSTUseImages(0, $shopcg['configId'], $scdata['shopBanner'],'shop_configs','shopBanner');
WSTUseImages(0, $shopcg['configId'], $scdata['shopAds'],'shop_configs','shopAds');
$rs = $this->where("shopId=".$shopId)->update($scdata);
if($rs!==false){
Db::commit();
return WSTReturn('操作成功',1);
}
}catch (\Exception $e) {
Db::rollback();errLog($e);
}
return WSTReturn('操作失败',-1);
}
/**
* 获取商城搜索关键字
*/
public function searchShopkey($shopId){
$rs = $this->where('shopId='.$shopId)->field('configId,shopHotWords')->find();
$keys = [];
if($rs['shopHotWords']!='')$keys = explode(',',$rs['shopHotWords']);
return $keys;
}
}