Initial commit,修正
This commit is contained in:
Executable
+91
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
//取data表数据
|
||||
$suffix = 'data';
|
||||
$tableName = $tablePre.'_'.$table.'_'.$suffix;
|
||||
$condition = "";
|
||||
$params = array();
|
||||
|
||||
$condition .="`o_sn` = :o_sn";
|
||||
$params[':o_sn'] = $o_sn;
|
||||
$condition .=" AND ";
|
||||
$condition .="`f_sn` = :f_sn";
|
||||
$params[':f_sn'] = $f_sn;
|
||||
$condition .=" AND ";
|
||||
$condition .="`s_sn` = :s_sn";
|
||||
$params[':s_sn'] = $s_sn;
|
||||
$condition .=" AND ";
|
||||
$condition .="`siteid` = :siteid";
|
||||
$params[':siteid'] = $siteId;
|
||||
$condition .=" AND ";
|
||||
$condition .="`platid` = :platid";
|
||||
$params[':platid'] = $platid;
|
||||
$condition .=" AND ";
|
||||
$condition .="`uniacid` = :uniacid";
|
||||
$params[':uniacid'] = $uniacid;
|
||||
$condition .=" AND ";
|
||||
$condition .="`shopid` = :shopid";
|
||||
$params[':shopid'] = $shopid;
|
||||
|
||||
switch($op)
|
||||
{
|
||||
case 'unused': //取未删除、不可用状态的数据
|
||||
$condition .=" AND ";
|
||||
$condition .="`status` = :status";
|
||||
$params[':status'] = 0;
|
||||
$condition .=" AND ";
|
||||
$condition .="`deleted` = :deleted";
|
||||
$params[':deleted'] = 0;
|
||||
break;
|
||||
|
||||
case 'deleted': //取已删除数据
|
||||
$condition .=" AND ";
|
||||
$condition .="`deleted` = :deleted";
|
||||
$params[':deleted'] = 1;
|
||||
break;
|
||||
|
||||
default: //默认,取未删除、可用状态的数据
|
||||
$condition .=" AND ";
|
||||
$condition .="`status` = :status";
|
||||
$params[':status'] = 1;
|
||||
$condition .=" AND ";
|
||||
$condition .="`deleted` = :deleted";
|
||||
$params[':deleted'] = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
$columns = ['setfor','title','key','value'];
|
||||
|
||||
$result = fmFunc_pdo_yii_getall($connection, $tableName, $columns, $condition, $params, $limits = array(), $showorders=array());
|
||||
$record = array();
|
||||
if($result){
|
||||
foreach($result as $_k => $_v){
|
||||
$setfor = $_v['setfor'];
|
||||
$title = $_v['title'];
|
||||
$key = $_v['key'];
|
||||
$value = iunserializer($_v['value']);
|
||||
$str = $setfor.'_'.$title.'_'.$key.'.php';
|
||||
$len = 0-strlen($str);
|
||||
if(!empty($value) && is_string($value) && substr($value,$len)==$str){
|
||||
if(fmFunc_file_checkExist($value,'data/')){
|
||||
$value = fmFunc_file_dataLoad($value);
|
||||
}
|
||||
}
|
||||
$record[$setfor][$title][$key] = $value;
|
||||
|
||||
if($setfor == $title){
|
||||
if($title == $key){
|
||||
$record[$setfor] = $value;
|
||||
}else{
|
||||
$record[$setfor][$key] = $value;
|
||||
}
|
||||
}else{
|
||||
if($title == $key){
|
||||
$record[$setfor][$title] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$errorCode = 45300302;
|
||||
}
|
||||
$result = $record;
|
||||
Reference in New Issue
Block a user