You've already forked qlg.tsgz.moe
addons
app_download_files
extend
hyhproject
admin
behavior
common
conf
controller
model
Accreds.php
AdPositions.php
Addons.php
Adgoods.php
Ads.php
Alipays.php
Areas.php
ArticleCats.php
Articles.php
Attributes.php
Banks.php
Base.php
Brands.php
Carts.php
CashDraws.php
ChargeItems.php
CronJobs.php
DataCats.php
Datas.php
EctDay.php
EctDeal.php
EctTarget.php
Express.php
Friendlinks.php
Goods.php
GoodsAppraises.php
GoodsCats.php
GoodsClassify.php
GoodsConsult.php
HomeMenus.php
Hooks.php
Images.php
Index.php
Informs.php
LogMoneys.php
LogOperates.php
LogSms.php
LogStaffLogins.php
LogSysData.php
Member.php
Menus.php
Messages.php
MobileBtns.php
Navs.php
OrderComplains.php
OrderRefunds.php
Orders.php
Payments.php
Privileges.php
Recommends.php
Reports.php
Roles.php
Settlements.php
Shops.php
SpecCats.php
Staffs.php
Styles.php
SysConfigs.php
TemplateMsgs.php
TradeRule.php
UserRanks.php
UserScores.php
Users.php
Weixinpays.php
WeixinpaysApp.php
WxPassiveReplys.php
WxTemplateParams.php
Wxmenus.php
Wxusers.php
validate
view
app
common
home
home2
mobile2
wechat2
.htaccess
command.php
mobile
oss
static
thinkphp
upload
vendor
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5436787D.wgt
admin.php
app-release.apk
app_download.html
cash.lock
demo.php
get_version.php
get_version_new.php
index.html
index.php
reg.lock
robots.txt
147 lines
2.9 KiB
PHP
Executable File
147 lines
2.9 KiB
PHP
Executable File
<?php
|
|
|
|
namespace wstmart\admin\model;
|
|
|
|
/**
|
|
|
|
* ============================================================================
|
|
|
|
* 商城配置业务处理
|
|
|
|
*/
|
|
|
|
use think\Db;
|
|
|
|
class SysConfigs extends Base{
|
|
|
|
/**
|
|
|
|
* 获取商城配置
|
|
|
|
*/
|
|
|
|
public function getSysConfigs(){
|
|
|
|
$rs = $this->field('fieldCode,fieldValue')->select();
|
|
|
|
$rv = [];
|
|
|
|
$split = [
|
|
|
|
'submitOrderTipUsers','payOrderTipUsers','cancelOrderTipUsers','rejectOrderTipUsers','refundOrderTipUsers','complaintOrderTipUsers','cashDrawsTipUsers'
|
|
|
|
];
|
|
|
|
foreach ($rs as $v){
|
|
|
|
if(in_array($v['fieldCode'],$split)){
|
|
|
|
$rv[$v['fieldCode']] = ($v['fieldValue']=='')?[]:explode(',',$v['fieldValue']);
|
|
|
|
}else{
|
|
|
|
$rv[$v['fieldCode']] = $v['fieldValue'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$signScore = explode(",",$rv['signScore']);
|
|
|
|
for($i=0;$i<31;++$i){
|
|
|
|
$rv['signScore'.$i] = ($signScore[0]==0)?0:$signScore[$i];
|
|
|
|
}
|
|
|
|
return $rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 编辑
|
|
|
|
*/
|
|
|
|
public function edit($fieldType = 0){
|
|
\think\Cache::clear();
|
|
if(1 == input('isDataConfigs')){
|
|
$data = input('post.');
|
|
unset($data['isDataConfigs']);
|
|
$m = Model('Table');
|
|
$m->setTable('data_configs');
|
|
Db::startTrans();
|
|
try{
|
|
foreach ($data as $k=>$v) {
|
|
$m->updateInfo(['configId'=>$k],['fieldValue'=>$v]);
|
|
}
|
|
if (isset($data['jiri_jiyan'])) {
|
|
$this->update(['fieldValue'=>$data['jiri_jiyan']],['fieldCode'=>'jiri_jiyan']);
|
|
}
|
|
if (isset($data['jiri_get_percent'])) {
|
|
$this->update(['fieldValue'=>floatval($data['jiri_get_percent'])],['fieldCode'=>'jiri_get_percent']);
|
|
}
|
|
if (isset($data['jiri'])) {
|
|
$time = strtotime($data['jiri']);
|
|
if (empty($time)) {return WSTReturn("操作失败;吉日日期格式不对", 1);}
|
|
$this->update(['fieldValue'=>date('Y/m/d', $time)],['fieldCode'=>'jiri']);
|
|
}
|
|
Db::commit();
|
|
return WSTReturn("操作成功", 1);
|
|
}catch (\Exception $e) {
|
|
Db::rollback();errLog($e);
|
|
}
|
|
}else{
|
|
$list = $this->where('fieldType',$fieldType)->field('configId,fieldCode,fieldValue')->select();
|
|
Db::startTrans();
|
|
|
|
try{
|
|
|
|
foreach ($list as $key =>$v){
|
|
|
|
$code = trim($v['fieldCode']);
|
|
|
|
if(in_array($code,['wstVersion','wstMd5','wstMobileImgSuffix','mallLicense']))continue;
|
|
|
|
$val = Input('post.'.trim($v['fieldCode']));
|
|
|
|
//启用图片
|
|
|
|
if(substr($val,0,7)=='upload/' && strpos($val,'.')!==false){
|
|
|
|
WSTUseImages(1, $v['configId'],$val, 'sys_configs','fieldValue');
|
|
|
|
}
|
|
|
|
$this->update(['fieldValue'=>$val],['fieldCode'=>$code]);
|
|
|
|
}
|
|
|
|
Db::commit();
|
|
|
|
cache('WST_CONF',null);
|
|
|
|
return WSTReturn("操作成功", 1);
|
|
|
|
}catch (\Exception $e) {
|
|
|
|
Db::rollback();errLog($e);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
return WSTReturn("操作失败", 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|