File: /www/wwwroot/cs.wgegeghx.com/application/pay/uninstall/uninstall.php
<?php
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// | 卸载脚本
namespace app\pay\uninstall;
use think\Db;
use \sys\UninstallBase;
class Uninstall extends UninstallBase
{
//固定相关表
private $modelTabList = array(
'pay_account',
'pay_payment',
'pay_spend',
);
//卸载
public function run()
{
if (request()->param('clear') == 1) {
//删除固定表
if (!empty($this->modelTabList)) {
foreach ($this->modelTabList as $tablename) {
if (!empty($tablename)) {
$tablename = config('database.prefix') . $tablename;
Db::execute("DROP TABLE IF EXISTS `{$tablename}`;");
}
}
}
}
return true;
}
}