Pursuing a dream linkage category - Area reason for the call third-class city is not displayed

Pursuing a dream linkage category - Area reason for the call third-class city is not displayed

1, the data type field nativeplace additional table dede_addoninfos or your other table is int type, can not save the third-class city of evalue corresponding value (for example: 10001.001 corresponding Dongshan District)

2, the enumeration table dede_sys_enum third-class city evalue value corresponding to an error (for example: Dongshan District 10001.1 should Dongshan District 10001.001)

Pursuing a dream linkage category - regional solutions to call the third-class city is not displayed

1, additional table dede_addoninfos nativeplace modify the field or your other tables it char-data type

Background - System -SQL command-line tool, about the implementation of this statement

ALTER TABLE dede_addoninfos CHANGE nativeplace nativeplace CHAR( 20 ) NOT NULL DEFAULT '0'

Note: dede_addoninfos you add the table name, if you remember the other model into your

2, the correction table dede_sys_enum enumerate all third-class city corresponding value evalue

Open /include/enums.func.php found

foreach($egroups as $egroup)

Added on top of it

if($egroup == 'nativeplace' || $egroups['nativeplace'] == 'nativeplace')
{
	$dsql->SetQuery("SELECT id,evalue FROM `#@_sys_enum` WHERE egroup='nativeplace'"); $dsql->Execute(); while($row = $dsql->GetArray()) { $res[]= $row; } foreach($res as $k=>$v) { if(preg_match("#([0-9]{1,})\.([0-9]{1,})#", $v['evalue'], $matchs)) { $valKey = $matchs[1] + $matchs[2] / 1000; $v['evalue'] = $valKey; $sql ="UPDATE `#@_sys_enum` SET evalue=".$v['evalue'] ." WHERE id=".$v['id']; $dsql->ExecuteNoneQuery($sql); } } }

Finally, in the background - Linkage Category Management - Update [region] about the update cache

Guess you like

Origin www.cnblogs.com/lanne/p/11498295.html