/**
  *导入城市指南分类
  *@date 2010-4-27
  *@time 下午02:14:17
  */
 function excity()
 {
     //导入城市指南分类
     $old = M("Sort");
     $list = $old->order("fid asc")->findAll();
     $dao = new Model();
     $sql = "INSERT INTO `iic_arctype` (`id`, `reid`, `topid`, `sortrank`, `typename`, `ename`, `typedir`, `issend`, `channeltype`, `uid`, `cid`, `maxpage`, `ispart`, `corank`, `tempindex`, `templist`, `temparticle`, `namerule`, `namerule2`, `modname`, `description`, `keywords`, `seotitle`, `moresite`, `sitepath`, `siteurl`, `ishidden`, `cross`, `hits`, `posttime`, `mtime`, `crossid`, `content`, `smalltypes`)";
     $sql .= " VALUES (1000, '0', '0', '0', 'City Guide', 'cityguide', '', '', '2', 0, '', '25', '0', '', '', '', '', '', '', '', '', 'description', '', '', '', '', '', '0', 0," . time() . ", 0, '', '', '1000__1000');";
     if ($dao->execute($sql)) {
         echo '写入城市指南大类成功';
     } else {
         echo '<b>写入城市指南大类不成功</b>';
     }
     echo '<br>';
     //dump($list);
     foreach ($list as $v) {
         $v['fid'] = $v['fid'] + 1000;
         $v['fup'] = $v['fup'] + 1000;
         $sql = "INSERT INTO `iic_arctype` (`id`, `reid`, `topid`, `sortrank`, `typename`, `ename`, `typedir`, `issend`, `channeltype`, `uid`, `cid`, `maxpage`, `ispart`, `corank`, `tempindex`, `templist`, `temparticle`, `namerule`, `namerule2`, `modname`, `description`, `keywords`, `seotitle`, `moresite`, `sitepath`, `siteurl`, `ishidden`, `cross`, `hits`, `posttime`, `mtime`, `crossid`, `content`, `smalltypes`)";
         $sql .= "VALUES (";
         $sql .= "{$v['fid']},{$v['fup']},1000,{$v['list']},'{$v['name']}','','','',";
         $sql .= 2;
         //系统模型
         $sql .= ",'','','25','{$v['type']}','','','','','','','','','description','{$v['name']}','','','','','0','0','" . time() . "','0','','','{$v['fid']}__{$v['fup']}');";
         // `description`, `keywords`, `seotitle`, `moresite`, `sitepath`, `siteurl`, `ishidden`, `cross`, `hits`, `posttime`, `mtime`, `crossid`, `content`, `smalltypes`
         //echo $sql;
         if ($dao->execute($sql)) {
             echo '分类:' . $v['fid'] . '-> ' . $v['name'] . '执行成功';
         } else {
             echo '分类:' . $v['fid'] . '-> ' . $v['name'] . '执行不成功';
         }
         echo "<br>";
     }
 }
Example #2
0
 public function create($sqlFlag = false)
 {
     $sql = "REPLACE INTO {$this->tableName} VALUES (\n                '{$this->school}','{$this->gradeId}','{$this->classId}','{$this->className}',\n                '{$this->stuName}', '{$this->stuId}', {$this->sex},'{$this->nationId}','{$this->birthDay}',\n                '{$this->sourcePlace}','{$this->IDCard}','{$this->homeAddress}',{$this->height}, {$this->weight},\n                {$this->BMIMark}, {$this->BMIScore}, {$this->BMIGrade},\n                {$this->FVCMark}, {$this->FVCScore}, {$this->FVCGrade},\n                {$this->_50mMark}, {$this->_50mScore}, {$this->_50mGrade},\n                {$this->SARMark}, {$this->SARScore}, {$this->SARGrade},\n                {$this->SLJMark}, {$this->SLJScore}, {$this->SLJGrade},\n                {$this->ChinUpMark}, {$this->ChinUpScore}, {$this->ChinUpAdditionalScore}, {$this->ChinUpGrade},\n                {$this->SitUpsMark}, {$this->SitUpsScore}, {$this->SitUpsAdditionalScore}, {$this->SitUpsGrade},\n                '{$this->_1000mMark}', {$this->_1000mScore}, {$this->_1000mAdditionalScore}, {$this->_1000mGrade},\n                '{$this->_800mMark}', {$this->_800mScore}, {$this->_800mAdditionalScore}, {$this->_800mGrade},\n                '{$this->_400mMark}', {$this->_400mScore}, {$this->_400mAdditionalScore}, {$this->_400mGrade},\n                {$this->ropeSkippingMark}, {$this->ropeSkippingScore}, {$this->ropeSkippingAdditionalScore}, {$this->ropeSkippingGrade},\n                {$this->standardPoints}, {$this->additionalPoints}, {$this->SumUpScore},  {$this->SumUpGrade}\n                )\n                ";
     //        echo $sql;
     if ($sqlFlag) {
         return $sql . ';';
     }
     return parent::execute($sql);
 }
Example #3
0
 function save()
 {
     $this->import_parameters();
     if (!isset($this->notes) || empty($this->notes)) {
         $sql = "DELETE from project_notes\n                    WHERE project_id = {$this->project_id}";
         return parent::execute($sql);
     } else {
         return parent::save();
     }
 }
Example #4
0
 public function upDateCheckNameForm()
 {
     /*得到课程ID名字加工后即是要找的这张表*/
     $course_id = I('course_id');
     $check_name_table = "check_name_" . $course_id;
     $student_id = I('student_id');
     //$data['student_name'] =I('student_name'); 后期再处理
     $update = new Model();
     $update->execute("update {$check_name_table} set attend_stage='attend' where student_id='{$student_id}' ");
     //$update->execute("update $check_name_table set attend_stage='attend' where student_id=$student_id ");
     $this->ajaxReturn(1);
 }
Example #5
0
 public function result()
 {
     //这个id是指 赛事组织配置id
     $id = (int) $this->_get('id');
     $token = session('token');
     $where = " a.token='" . $token . "' and a.id=" . $id . " and a.zhudui=b.id and a.kedui=c.id";
     $changci_db = new Model();
     $changci = $changci_db->table(C('DB_PREFIX') . "jingcai_changci a," . C('DB_PREFIX') . "jingcai_team b," . C('DB_PREFIX') . "jingcai_team c")->field("a.*,b.name zhuduiname,c.name keduiname")->where($where)->find();
     $this->assign('info', $changci);
     if (IS_POST) {
         $zhuduinum = $this->_post('zhuduinum');
         $keduinum = $this->_post('keduinum');
         /**
          * 给成功竞猜的人增加积分
          */
         if ($zhuduinum > $keduinum) {
             $type = 3;
         } elseif ($zhuduinum == $keduinum) {
             $type = 1;
         } else {
             $type = 2;
         }
         $Model = new Model();
         $score_dtl_sql = "insert into `" . C('DB_PREFIX') . "member_card_sign`(`sign_time`,`is_sign`,`score_type`,`token`,`wecha_id`,`expense`,`score_name`)" . " select '" . time() . "'," . "       1,36,token,wecha_id,sjm,'2333'" . " from `" . C('DB_PREFIX') . "jingcai_changci_record`  where `token`='" . $this->token . "' and `changci_id`=" . $id . " and `ycjg`=" . $type . " ";
         $Model->execute($score_dtl_sql);
         $userinfo_sql = "update `" . C('DB_PREFIX') . "userinfo` a  set a.total_score=(select sjm+a.total_score from `" . C('DB_PREFIX') . "jingcai_changci_record` c where c.token='" . $this->token . "' and c.changci_id=" . $id . " and c.ycjg=" . $type . " and a.wecha_id=c.wecha_id )" . " where `token`='" . $this->token . "' and exists (select 1 from `" . C('DB_PREFIX') . "jingcai_changci_record` b where b.token='" . $this->token . "' and b.changci_id=" . $id . " and b.ycjg=" . $type . " and a.wecha_id=b.wecha_id  )";
         $Model->execute($userinfo_sql);
         M('jingcai_changci')->where(array('token' => $token, 'id' => $id))->save(array('zhuduinum' => $zhuduinum, 'keduinum' => $keduinum, 'status' => 1));
         $this->success('该赛事已成功结束', U('Jingcai/changci', array('token' => session('token'), 'id' => $changci['type_id'])));
         die;
     }
     $this->display();
 }
Example #6
0
 public function delfile($id)
 {
     $where['id'] = $id;
     //删除静态文件
     $array = $this->InfoDB->field('id,cid,picurl,title')->where($where)->find();
     @unlink('./' . C('upload_path') . '/' . $array['picurl']);
     if (C('url_html')) {
         //删除内容页
         @unlink(C('webpath') . get_read_url_dir('info', $array['id'], $array['cid']) . C('html_file_suffix'));
     }
     //删除专题收录
     $rs = new Model();
     $rs->execute("update " . C('db_prefix') . "special set aids=Replace(Replace(Replace(Replace\n\t\t\t(CONCAT(',,',aids,',,'),',{$id},',','),',,,,',''),',,,',''),',,','')");
     //
     $this->InfoDB->where($where)->delete();
 }
Example #7
0
 public function insert()
 {
     if ($_POST['address'] == null) {
         $this->error('请先填写地址哦亲');
     }
     if ($_POST['address'] == 0) {
         if ($_POST['new_address'] == null || $_POST['receiver'] == null || $_POST['phone'] == null || $_POST['zipcode'] == null) {
             $this->error("请填写详细的新地址");
         }
         $data['uid'] = $_SESSION['user']['id'];
         $data['area'] = $_POST['s_province'] . $_POST['s_city'] . $_POST['s_county'];
         $data['address'] = $_POST['new_address'];
         $data['receiver'] = $_POST['receiver'];
         $data['phone'] = $_POST['phone'];
         $data['zipcode'] = $_POST['zipcode'];
         $address = M("address");
         $result = $address->add($data);
         if ($result) {
             $ordergoods = $_POST['cartgoods'];
             $ordergoodsid = implode(',', $ordergoods);
             $c = M("cart");
             $goodsnum = $c->where("uid={$_SESSION['user']['id']} and gid in ({$ordergoodsid})")->select();
             foreach ($goodsnum as $key => $value) {
                 $ordergoodsnum[] = $value['num'];
             }
             $ordergoodsnum = implode(',', $ordergoodsnum);
             $name = time();
             $time = time();
             $data['name'] = $name;
             $data['user_id'] = $_SESSION['user']['id'];
             $data['goods_id'] = $ordergoodsid;
             $data['address_id'] = $result;
             $data['goods_num'] = $ordergoodsnum;
             $data['time'] = $time;
             $data['price'] = $_POST['ordertotalprice'];
             $o = M("order");
             $order = $o->add($data);
             $c = M("cart");
             if ($order > 0) {
                 //如果下单成功 则删除购物车的商品
                 $delgoods = $c->execute("delete from qd_cart where gid in ({$ordergoodsid})");
                 $reserveid = explode(',', $ordergoodsid);
                 $reservenum = explode(',', $ordergoodsnum);
                 foreach ($reserveid as $key => $value) {
                     $result = $c->execute("update qd_goods set reserve=reserve-{$reservenum[$key]} where id={$value}");
                 }
                 $this->success("下单成功", "__APP__/Showcart/index");
             } else {
                 $this->error("加入订单失败");
             }
         }
     } else {
         $ordergoods = $_POST['cartgoods'];
         $ordergoodsid = implode(',', $ordergoods);
         $c = M("cart");
         $goodsnum = $c->where("uid={$_SESSION['user']['id']} and gid in ({$ordergoodsid})")->select();
         foreach ($goodsnum as $key => $value) {
             $ordergoodsnum[] = $value['num'];
         }
         $ordergoodsnum = implode(',', $ordergoodsnum);
         $addressid = $_POST['address'];
         $name = time();
         $time = time();
         $data['name'] = $name;
         $data['user_id'] = $_SESSION['user']['id'];
         $data['goods_id'] = $ordergoodsid;
         $data['address_id'] = $addressid;
         $data['goods_num'] = $ordergoodsnum;
         $data['time'] = $time;
         $data['price'] = $_POST['ordertotalprice'];
         $o = M("order");
         $order = $o->add($data);
         $c = new Model();
         if ($order > 0) {
             //如果下单成功 则删除购物车的商品
             $delgoods = $c->execute("delete from qd_cart where gid in ({$ordergoodsid})");
             $reserveid = explode(',', $ordergoodsid);
             $reservenum = explode(',', $ordergoodsnum);
             foreach ($reserveid as $key => $value) {
                 $result = $c->execute("update qd_goods set reserve=reserve-{$reservenum[$key]} where id={$value}");
             }
             $this->success("下单成功", "__APP__/Showcart/index");
         } else {
             $this->error("加入订单失败");
         }
     }
 }
 public function delfile($id)
 {
     //删除静态文件
     $array = $this->VideoDB->field('id,cid,picurl,title,playurl')->where('id = ' . intval($id))->find();
     @unlink('./' . C('upload_path') . '/' . $array['picurl']);
     @unlink('./' . C('upload_path') . '-s/' . $array['picurl']);
     if (C('url_html')) {
         //删除内容页
         @unlink(C('webpath') . get_read_url_dir('video', $array['id'], $array['cid']) . C('html_file_suffix'));
         //删除播放页
         if (C('url_html_play')) {
             $count = 1;
             if (C('url_html_play') == 2) {
                 $count = $this->playlist($array['playurl'], $array['id'], $array['cid']);
                 $count = $count[0]['playcount'];
             }
             for ($i = 0; $i < $count; $i++) {
                 $dirurl = get_play_url_dir($array['id'], $array['cid'], $i) . C('html_file_suffix');
                 @unlink($dirurl);
             }
         }
     }
     //删除专题收录
     $rs = new Model();
     $rs->execute("update " . C('db_prefix') . "special set mids=Replace(Replace(Replace(Replace\n\t\t\t(CONCAT(',,',mids,',,'),',{$id},',','),',,,,',''),',,,',''),',,','')");
     //删除影片ID
     $where['id'] = $id;
     $this->VideoDB->where($where)->delete();
     unset($where);
     //删除观看主录
     $where['did'] = $id;
     $this->UserVDB->where($where)->delete();
     unset($where);
     //删除相关评论
     $where['did'] = $id;
     $where['mid'] = 1;
     $this->CommDB->where($where)->delete();
 }
 public function save()
 {
     $sql = "UPDATE tice_config SET\n                schoolType = {$this->schoolType},\n                beginRow = {$this->beginRow},\n                dataSheetNum = '{$this->dataSheetNum}',\n                column1 = '{$this->column1}',column2 = '{$this->column2}',column3 = '{$this->column3}',column4 = '{$this->column4}',column5 = '{$this->column5}',\n                column6 = '{$this->column6}',column7 = '{$this->column7}',column8 = '{$this->column8}',column9 = '{$this->column9}',column10 = '{$this->column10}',\n                column11 = '{$this->column11}',column12 = '{$this->column12}',column13 = '{$this->column13}',column14 = '{$this->column14}',column15 = '{$this->column15}',\n                column16 = '{$this->column16}',column17 = '{$this->column17}',column18 = '{$this->column18}',column19 = '{$this->column19}',column20 = '{$this->column20}',\n                column21 = '{$this->column21}',column22 = '{$this->column22}',column23 = '{$this->column23}',column24 = '{$this->column24}',column25 = '{$this->column25}',\n                column26 = '{$this->column26}',column27 = '{$this->column27}',column28 = '{$this->column28}',column29 = '{$this->column29}',column30 = '{$this->column30}',\n                column31 = '{$this->column31}',column32 = '{$this->column32}',column33 = '{$this->column33}',column34 = '{$this->column34}',column35 = '{$this->column35}',\n                column36 = '{$this->column36}',column37 = '{$this->column37}',column38 = '{$this->column38}',column39 = '{$this->column39}',column40 = '{$this->column40}',\n                column41 = '{$this->column41}',column42 = '{$this->column42}',column43 = '{$this->column43}',column44 = '{$this->column44}',column45 = '{$this->column45}',\n                column46 = '{$this->column46}',column47 = '{$this->column47}',column48 = '{$this->column48}',column49 = '{$this->column49}',column50 = '{$this->column50}',\n                column51 = '{$this->column51}',column52 = '{$this->column52}',column53 = '{$this->column53}',column54 = '{$this->column54}',column55 = '{$this->column55}',\n                column56 = '{$this->column56}',column57 = '{$this->column57}',modifyTime = NOW()\n                ";
     //        print_r($sql);
     return parent::execute($sql);
 }
Example #10
0
        print $jsonarray;
    }
} elseif (isset($_POST["php_title"]) && $_POST["php_operate"] === 'qu-cat') {
    $id = $_POST['php_id'];
    $title = $_POST['php_title'];
    $describe = $_POST['php_describe'];
    $conn = new Connection();
    $model = new Model();
    $sql = "UPDATE category SET title = '" . $title . "',describe_cat = '" . $describe . "' \n\t\t\t\tWHERE id = " . $id . ";";
    $result = $model->execute($sql);
    if (!$result) {
        die("Database query failed.");
    } else {
        $rows = $model->select('SELECT * FROM category');
        $jsonarray = json_encode($rows);
        print $jsonarray;
    }
} elseif (isset($_POST["php_id"]) && $_POST["php_operate"] === 'qd-cat') {
    $id = $_POST['php_id'];
    $conn = new Connection();
    $model = new Model();
    $sql = "DELETE FROM category WHERE id = " . $id . ";";
    $result = $model->execute($sql);
    if (!$result) {
        die("Database query failed.");
    } else {
        $rows = $model->select('SELECT * FROM category');
        $jsonarray = json_encode($rows);
        print $jsonarray;
    }
}
Example #11
0
 public function resetPasswd()
 {
     $sql = "UPDATE tice_user SET password = '******' WHERE stuId = {$this->stuId} LIMIT 1";
     return parent::execute($sql);
 }
Example #12
0
 public function article()
 {
     $model = D("Archives");
     $id = $_REQUEST["id"];
     $vo = $model->where("id = " . $id)->find();
     if ($vo['arcrank'] == "-1") {
         $this->error('文档未审核!', C("site_url"));
     }
     //click+1
     $Model = new Model();
     $Model->execute("UPDATE " . C("DB_PREFIX") . "archives SET click=click+1 WHERE id=" . $id);
     $model = M("Addon" . $vo['channel']);
     $vo1 = $model->where("aid = " . $id)->find();
     if (empty($vo1)) {
         $vo1 = array();
     }
     $result = array_merge($vo, $vo1);
     $this->assign('vo', $result);
     $type = M("Arctype")->where("id=" . $vo['typeid'])->find();
     $this->assign('type', $type);
     $this->display(str_replace(".html", "", $type['temparticle']));
 }
 /**
  *记录关键字
  *@date 2010-10-29
  *@time 上午10:45:24
  */
 function _so_key($key)
 {
     //记录关键字
     $time = time();
     $sql = "INSERT INTO `iic_so_key` (`id` ,`keyword` ,`ctime` ,`mtime` ,`hot`) VALUES (NULL , '{$key}', '{$time}', '{$time}', '0') ON DUPLICATE KEY UPDATE `mtime` = '{$time}', `hot`=`hot`+1;";
     $m = new Model();
     return $m->execute($sql);
 }
    public function enterprise_user_management_ajaxpost()
    {
        // 		$A=1;
        // 		$ans=json_encode($A);
        // $this->ajaxReturn( "shibai");
        $munit = M('user');
        $userid = I('post.user_id');
        $type = I('post.usertype');
        if (I('post.action') == "lock") {
            if (I('post.value') == '0') {
                $data['lock'] = '0';
            } else {
                $data['lock'] = '1';
            }
            $result = $munit->where(array('user_id' => I('post.user_id')))->save($data);
            if ($result) {
                $ans = json_encode("成功");
                $this->ajaxReturn($ans, 'JSON');
            } else {
                $ans = json_encode("失败");
                $this->ajaxReturn($ans, 'JSON');
            }
            // $this->show( "lock_ok".I( 'post.user_id' ) );
        } else {
            if (I('post.action') == "verify") {
                $result = $munit->where("user_id='{$userid}'")->setField('is_verify', 1);
                if ($result > 0) {
                    if ($type == 5) {
                        $prefix = "production_unit";
                    } else {
                        if ($type == 7) {
                            $prefix = "reception_unit";
                        } else {
                            $ans = json_encode("成功");
                            $this->ajaxReturn($ans, 'JSON');
                        }
                    }
                    $mx = M($prefix)->where("user_id='{$userid}'")->getField($prefix . '_id');
                    $tablename = $prefix . "_" . $mx;
                    if ($prefix == "production_unit") {
                        $sql = 'create table ' . $tablename . ' (
 					id int(11) NOT NULL AUTO_INCREMENT,
 					rfid_id varchar(255) DEFAULT NULL,
  					waste_category_id int(11) DEFAULT NULL,
  					add_weight double DEFAULT NULL,
  					add_date_time datetime DEFAULT NULL,
  					add_num int(11) DEFAULT NULL,
  					android_num varchar(255) DEFAULT NULL,
  					PRIMARY KEY (id),
  					KEY fk_waste_category_id_' . $tablename . ' (waste_category_id) USING BTREE,
  					CONSTRAINT fk_waste_category_id_' . $tablename . ' FOREIGN KEY (waste_category_id) REFERENCES waste_category (waste_category_id)
					)';
                    } else {
                        $sql = 'create table ' . $tablename . ' (
 					id int(11) NOT NULL AUTO_INCREMENT,
 					rfid_id varchar(255) DEFAULT NULL,
  					waste_category_id int(11) DEFAULT NULL,
  					total_weight double DEFAULT NULL,
  					receive_date_time datetime DEFAULT NULL,
  					total_num int(11) DEFAULT NULL,
  					android_num varchar(255) DEFAULT NULL,
  					PRIMARY KEY (id),
  					KEY fk_waste_category_id_' . $tablename . ' (waste_category_id) USING BTREE,
  					CONSTRAINT fk_waste_category_id_' . $tablename . ' FOREIGN KEY (waste_category_id) REFERENCES waste_category (waste_category_id)
					)';
                    }
                    $model = new Model();
                    $model->execute($sql);
                    $num = M('information_schema.tables')->where("table_schema = 'dwms'\n\t\t\t\t\t\t\tAND table_name = '{$tablename}'")->count();
                    if ($num > 0) {
                        $ans = json_encode("成功");
                        $this->ajaxReturn($ans, 'JSON');
                    } else {
                        $ans = json_encode("创建数据库出现错误");
                        $this->ajaxReturn($ans, 'JSON');
                    }
                } else {
                    $ans = json_encode("未知错误");
                    $this->ajaxReturn($ans, 'JSON');
                }
                //	$this->show( "verify_ok".I( 'post.user_id' ) );
            } else {
                $this->error("action_error");
            }
        }
    }
Example #15
0
 public function delGroup($id = 0)
 {
     if ($id) {
         $where = "group_id =" . $id;
     } else {
         $this->error("请选择用户组");
     }
     $where['catpid'] = array('like', '%' . $id . '%');
     $where['id'] = array('eq', $id);
     $where['_logic'] = 'or';
     $mod = D("Commision");
     $moduc = D("user_commision");
     $list = $mod->where($where)->select();
     $delList = array();
     //删除id列表
     $upUser = array();
     //site_add删除id列表
     foreach ($list as $k => $v) {
         array_push($delList, $v['id']);
     }
     $list2 = $moduc->where("id in (" . $delList . ")")->select();
     foreach ($list2 as $k => $v) {
         array_push($upUser, $v['uid']);
     }
     $ret1 = $mod->where(array('id' => array('in', $delList)))->delete();
     $ret2 = $moduc->where(array('group_id' => array('in', $delList)))->delete();
     if ($ret1 && $ret2) {
         $Model = new Model();
         $sql = "update ds_user set uid = 0 where id in(" . $upUser . ")";
         $Model->execute($sql, false);
         $this->success('删除成功');
     } elseif ($ret1 && !$ret2) {
         $this->success('分组删除成功,分组与用户对应关系删除失败,请手动删除');
     } elseif (!$ret1 && $ret2) {
         $this->success(',分组与用户对应关系删除成功,分组删除失败,请手动删除');
     }
 }
 public function fmanage_insert()
 {
     $model = M("Channelfield");
     $this->assign('jumpUrl', Cookie::get('_currentUrl_'));
     $tmp = $model->where("chid=" . $this->_param("chid") . " and fieldname='" . $this->_param("fieldname") . "'")->find();
     if ($tmp) {
         $this->error('添加失败!该字段名已存在');
     }
     if (!$model->create()) {
         $this->error($model->getError());
     } else {
         if ($result = $model->add()) {
             $preffix = C("DB_PREFIX");
             $t = $this->_param("chid");
             if ($_POST['typeid'] == "0" || $_POST['typeid'] == "1") {
                 $cc = "varchar({$_POST['length']}) NOT NULL DEFAULT '{$_POST['fielddefault']}'";
             } elseif ($_POST['typeid'] == "2") {
                 $cc = "mediumtext";
             } elseif ($_POST['typeid'] == "3") {
                 $cc = "int(11) NOT NULL DEFAULT '0'";
             } elseif ($_POST['typeid'] == "4") {
                 $cc = "decimal(8,2) NOT NULL DEFAULT '0.00'";
             } elseif ($_POST['typeid'] == "5") {
                 $cc = "varchar(1000) NOT NULL DEFAULT ''";
             } elseif ($_POST['typeid'] == "6" || $_POST['typeid'] == "7" || $_POST['typeid'] == "8" || $_POST['typeid'] == "9") {
                 $cc = "varchar(200) NOT NULL DEFAULT ''";
             }
             //add Table
             $Model = new Model();
             $sql = "ALTER TABLE  `{$preffix}addon{$t}` ADD  `{$_POST['fieldname']}` {$cc}";
             $Model->execute($sql);
             //echo $sql;exit;
             $this->success('添加成功!');
         } else {
             $this->error('添加失败!');
         }
     }
 }
Example #17
0
 public function article_check()
 {
     $model = M("Archives");
     $id = $_REQUEST["id"];
     $ids = explode(',', $id);
     if (isset($id)) {
         $condition = array("id" => array('in', $ids));
         $list = $model->where($condition)->save(array("arcrank" => 0));
         if ($list !== false) {
             foreach ($ids as $v) {
                 $mids = $model->where("id=" . $v)->field("mid")->find();
                 $mid = $mids['mid'];
                 if ($mid) {
                     //插入积分日志
                     $log = M("Score_log");
                     $tmp = $log->where('typeid=3 and mid=' . $mid . ' and aid=' . $v)->find();
                     if (empty($tmp)) {
                         $log->add(array('mid' => $mid, 'typeid' => 3, 'aid' => $v, 'addtime' => time(), 'score' => C("cfg_archive"), 'summary' => '发布文档获取积分'));
                         //update user scores
                         $Model = new Model();
                         $Model->execute("update " . C("DB_PREFIX") . "member set scores=scores+" . C("cfg_archive") . " where  mid=" . $mid);
                     }
                 }
             }
             $this->success('审核成功!');
         } else {
             $this->error('审核失败!');
         }
     }
 }
Example #18
0
 /**
  * 重新排序后更新现有数据
  * @Title: changeSort
  * @Description: todo(这里用一句话描述这个方法的作用)   
  * @author quqiang 
  * @date 2015年5月13日 下午6:22:30 
  * @throws
  */
 function changeSort()
 {
     $sortArr = $_POST['data'];
     if ($sortArr) {
         $obj = new Model();
         $tablename = D('MisSystemDesignProperty')->getTableName();
         if ($tablename) {
             $sql = "INSERT INTO `{$tablename}` (id,sort) VALUES  {$sortArr} ON DUPLICATE KEY UPDATE sort=VALUES(sort);";
             $ret = $obj->execute($sql);
             $obj->commit();
             echo $ret;
         }
     }
 }
Example #19
0
 public function del()
 {
     $id = $this->_get('id', 'intval', 0);
     if (!$id) {
         $this->error('参数错误!');
     }
     $UserDB = D('User');
     $info = $UserDB->getUser(array('id' => $id));
     if ($info['username'] == C('SPECIAL_USER')) {
         //无视系统权限的那个用户不能删除
         $this->error('禁止删除此用户!');
     }
     //删除所属的前端用户、公众号、功能列表
     //删除公众号
     $model = new Model();
     $querystr = "delete a from tp_wxuser a, tp_users b where a.uid=b.id and b.belonguser="******"role_user")->where('user_id=' . $id)->delete()) {
             $this->assign("jumpUrl", U('User/index'));
             $this->success('删除成功!');
         } else {
             $this->error('用户成功,但角色对应关系删除失败!');
         }
     } else {
         $this->error('删除失败!');
     }
 }
Example #20
0
 public function registration()
 {
     $model = M("Score_log");
     $tmp = $model->where('typeid=1 and mid=' . $_SESSION[C('USER_AUTH_KEY')] . ' and addtime>' . strtotime(date("Y-m-d")))->find();
     if ($_POST) {
         if ($tmp) {
             $this->error("您今天已经签到过了", U("Member/registration"));
             exit;
         }
         $model->add(array('mid' => $_SESSION[C('USER_AUTH_KEY')], 'typeid' => 1, 'addtime' => time(), 'score' => C("cfg_registration_score"), 'summary' => '签到获取积分'));
         //update user scores
         $Model = new Model();
         $Model->execute("update " . C("DB_PREFIX") . "member set scores=scores+" . C("cfg_registration_score") . " where  mid=" . $_SESSION[C('USER_AUTH_KEY')]);
         $this->success("签到成功", U("Member/registration"));
         exit;
     }
     //列表过滤器,生成查询Map对象
     $map['mid'] = $_SESSION[C('USER_AUTH_KEY')];
     $map['typeid'] = 1;
     //$map = $this->_search ();
     if (method_exists($this, '_filter')) {
         $this->_filter($map);
     }
     //读取数据库模块列表生成菜单项
     //排序字段 默认为主键名
     if (!empty($_REQUEST['_order'])) {
         $order = $_REQUEST['_order'];
     } else {
         $order = !empty($sortBy) ? $sortBy : $model->getPk();
     }
     $order = 'addtime';
     //排序方式默认按照倒序排列
     //接受 sost参数 0 表示倒序 非0都 表示正序
     if (isset($_REQUEST['_sort'])) {
         $sort = $_REQUEST['_sort'] == 'asc' ? 'asc' : 'desc';
         //zhanghuihua@msn.com
     } else {
         $sort = $asc ? 'asc' : 'desc';
     }
     //取得满足条件的记录数
     $count = $model->where($map)->count();
     if ($count > 0) {
         import("@.ORG.Util.Page");
         //创建分页对象
         if (!empty($_REQUEST['listRows'])) {
             $listRows = $_REQUEST['listRows'];
         } else {
             $listRows = '';
         }
         $p = new Page($count, $listRows);
         //分页查询数据
         $voList = $model->where($map)->order("`" . $order . "` " . $sort)->limit($p->firstRow . ',' . $p->listRows)->select();
         //echo $model->getlastsql();
         //分页跳转的时候保证查询条件
         foreach ($map as $key => $val) {
             if (!is_array($val)) {
                 $p->parameter .= "{$key}=" . urlencode($val) . "&";
             }
         }
         //分页显示
         $page = $p->show();
         //列表排序显示
         $sortImg = $sort;
         //排序图标
         $sortAlt = $sort == 'desc' ? '升序排列' : '倒序排列';
         //排序提示
         $sort = $sort == 'desc' ? 1 : 0;
         //排序方式
         //模板赋值显示
         $this->assign('list', $voList);
         $this->assign('sort', $sort);
         $this->assign('order', $order);
         $this->assign('sortImg', $sortImg);
         $this->assign('sortType', $sortAlt);
         $this->assign("page", $page);
     }
     //zhanghuihua@msn.com
     $this->assign('t', $this->_param('t'));
     $this->assign('totalCount', $count);
     $this->assign('numPerPage', $p->listRows);
     $this->assign('currentPage', !empty($_REQUEST[C('VAR_PAGE')]) ? $_REQUEST[C('VAR_PAGE')] : 1);
     $this->assign('regis', $tmp);
     Cookie::set('_currentUrl_', __SELF__);
     $this->display();
 }
Example #21
0
 /**
 * @积分添加
 * @array	参数
 * @作者		shop猫
 * @版权		宁波天发网络
 * @官网		http://www.tifaweb.com http://www.dswjcms.com
 *--------------使用说明-----------------
 $add['member']=array(
 						'uid'=>1,	//用户名
 						'name'=>'mem_register',	//积分配置表中的积分名
 					);
 $this->integralAdd($add);//积分添加
 *--------------------------------------
 */
 public function integralAdd($array)
 {
     $Model = new Model();
     $inf = $this->integralConf();
     if (isset($array['member'])) {
         //会员积分
         if (isset($inf[$array['member']['name']])) {
             //判断用户提交上来的积分名是否存在积分配置表中
             $upda = $Model->execute("update ds_ufees set `total`=`total`+" . $inf[$array['member']['name']][0] . ",`available` = `available`+" . $inf[$array['member']['name']][0] . " where uid='" . $array['member']['uid'] . "'");
             //会员积分更新
             $ufee = $Model->table('ds_ufees')->where('uid=' . $array['member']['uid'])->find();
             if ($upda) {
                 $arr[0] = 1;
                 $arr[1] = $inf[$array['member']['name']][1];
                 $arr[2] = $inf[$array['member']['name']][0];
                 $arr[3] = '平台';
                 $arr[4] = $ufee['total'];
                 $arr[5] = $ufee['available'];
                 $arr[6] = $ufee['freeze'];
                 $moneyLog = $this->moneyLog($arr);
             }
         }
     }
     if (isset($array['vip'])) {
         //VIP
         if (isset($inf[$array['vip']['name']])) {
             //判断用户提交上来的积分名是否存在积分配置表中
             $upda = $Model->execute("update ds_vip_points set `total`=`total`+" . $inf[$array['vip']['name']][0] . ",`available` = `available`+" . $inf[$array['vip']['name']][0] . " where uid='" . $array['vip']['uid'] . "'");
             //VIP积分更新
             $ufee = $Model->table('ds_vip_points')->where('uid=' . $array['vip']['uid'])->find();
             if ($upda) {
                 $arr[0] = 2;
                 $arr[1] = $inf[$array['vip']['name']][1];
                 $arr[2] = $inf[$array['vip']['name']][0];
                 $arr[3] = '平台';
                 $arr[4] = $ufee['total'];
                 $arr[5] = $ufee['available'];
                 $arr[6] = $ufee['freeze'];
                 $moneyLog = $this->moneyLog($arr);
             }
         }
     }
     if (isset($array['promote'])) {
         //推广积分
         if (isset($inf[$array['promote']['name']])) {
             //判断用户提交上来的积分名是否存在积分配置表中
             $upda = $Model->execute("update ds_promote_integral set `total`=`total`+" . $inf[$array['promote']['name']][0] . ",`available` = `available`+" . $inf[$array['promote']['name']][0] . " where uid='" . $array['promote']['uid'] . "'");
             //会员积分更新
             $ufee = $Model->table('ds_promote_integral')->where('uid=' . $array['promote']['uid'])->find();
             if ($upda) {
                 $arr[0] = 3;
                 $arr[1] = $inf[$array['promote']['name']][1];
                 $arr[2] = $inf[$array['promote']['name']][0];
                 $arr[3] = '平台';
                 $arr[4] = $ufee['total'];
                 $arr[5] = $ufee['available'];
                 $arr[6] = $ufee['freeze'];
                 $moneyLog = $this->moneyLog($arr);
             }
         }
     }
     return 1;
 }
Example #22
0
function wasteOut($json_string)
{
    try {
        $devtable = M("device");
    } catch (Exception $e) {
        $error->code = 7;
        $error->des = urlencode('数据库连接失败');
        $error->rfid = $rfid;
        $resdata->error = $error;
        return $resdata;
    }
    if (ini_get("magic_quotes_gpc") == "1") {
        $json_string = stripslashes($json_string);
    }
    $json_data = json_decode($json_string);
    $rfidList = $json_data->rfidlist;
    $imei = $json_data->imei;
    $result = $devtable->where(" device_serial_num='{$imei}'")->find();
    $userId = null;
    $productionId = null;
    $ownershipType = null;
    if (!$result) {
        $error->code = 0;
        $error->des = urlencode('企业没有绑定手持设备');
        $resdata->error = $error;
        return $resdata;
    }
    $userId = $result['ownership_id'];
    $ownershipType = $result['ownership_type'];
    if ($ownershipType != 5) {
        $error->code = 17;
        $error->des = urlencode('该企业不是产生单位');
        $resdata->error = $error;
        return $resdata;
    }
    $pdutable = M('production_unit');
    $result1 = $pdutable->where(" production_unit_id='{$userId}'")->find();
    if (!$result1) {
        $error->code = 2;
        $error->des = urlencode('该用户没有企业');
        $resdata->error = $error;
        return $resdata;
    }
    $key = 0;
    $rfidtable = M('rfid');
    foreach ($rfidList as $rfidobj) {
        $rfid = $rfidobj->rfid;
        $result2 = $rfidtable->where(" rfid_id='{$rfid}'")->find();
        if (!$result2) {
            $error[$key]->code = 8;
            $error[$key]->des = urlencode('RFID标签没有绑定废物');
            $error[$key]->rfid = $rfid;
            $key++;
        } else {
            $stat = $result2['rfid_status'];
            if ($stat == 1 or $stat == 2) {
                $error[$key]->code = 12;
                $error[$key]->des = urlencode('废物已经出库');
                $error[$key]->rfid = $rfid;
                $key++;
            } elseif ($stat == 0) {
                $error[$key]->code = 14;
                $error[$key]->des = urlencode('废物为空');
                $error[$key]->rfid = $rfid;
                $key++;
            } else {
                $time = date("Y-m-d H:i:s");
                $Model = new Model();
                $sql1 = "UPDATE rfid SET modify_date_time = '{$time}',rfid_status = 1 WHERE rfid_id = '{$rfid}'";
                $resultx = $Model->execute($sql1);
                if (!$resultx) {
                    $error[$key]->code = 3;
                    $error[$key]->des = urlencode('更新RFID数据库失败');
                    $error[$key]->rfid = $rfid;
                    $key++;
                }
            }
        }
    }
    if (isset($error)) {
        $newerror['error'] = $error;
        return $newerror;
    } else {
        $resultData->code = 200;
        return $resultData;
    }
}
 public function remove()
 {
     if (IS_POST && isset($_POST['fromtype'])) {
         $catid = $this->_get("catid");
         if (!$catid) {
             $this->error("请指定栏目!");
         }
         //移动类型
         $fromtype = (int) $this->_post("fromtype");
         //需要移动的信息ID集合
         $ids = $_POST['ids'];
         //需要移动的栏目ID集合
         $fromid = $_POST['fromid'];
         //目标栏目
         $tocatid = (int) $this->_post("tocatid");
         if (!$tocatid) {
             $this->error("目标栏目不正确!");
         }
         switch ($fromtype) {
             //信息移动
             case 0:
                 if ($ids) {
                     if ($tocatid == $catid) {
                         $this->error("目标栏目和当前栏目是同一个栏目!");
                     }
                     $modelid = $this->categorys[$catid]['modelid'];
                     $tablename = ucwords($this->Model[$modelid]['tablename']);
                     $where = array();
                     if (!$ids) {
                         $this->error("请选择需要移动信息!");
                     }
                     $where['id'] = array("IN", $ids);
                     $where['catid'] = array("EQ", $catid);
                     if (M($tablename)->where($where)->save(array("catid" => $tocatid))) {
                         //点击表
                         $ids = explode(",", $ids);
                         $hits = M("Hits");
                         foreach ($ids as $id) {
                             $hits->where(array("hitsid" => "c-{$catid}-{$id}", "catid" => $catid))->save(array("catid" => $tocatid, "hitsid" => "c-{$tocatid}-{$id}"));
                         }
                         $this->success("移动成功,请使用《批量更新URL》更新新的地址!", U("Create_html/update_urls"));
                     } else {
                         $this->error("移动失败");
                     }
                 } else {
                     $this->error("请选择需要移动的信息!");
                 }
                 break;
                 //栏目移动
             //栏目移动
             case 1:
                 $fromid = implode(",", $fromid);
                 if (!$fromid) {
                     $this->error("请选择需要移动的栏目!");
                 }
                 $where = array();
                 $where['catid'] = array("IN", $fromid);
                 $modelid = $this->categorys[$catid]['modelid'];
                 $tablename = ucwords($this->Model[$modelid]['tablename']);
                 if (M($tablename)->where($where)->save(array("catid" => $tocatid))) {
                     //点击表
                     $Model = new Model();
                     $classid = explode(",", $fromid);
                     foreach ($classid as $catids) {
                         $Model->execute("update " . C("DB_PREFIX") . "hits set `hitsid`=replace(hitsid,'c-{$catids}-','c-{$tocatid}-'),`catid`= {$tocatid} where `catid`={$catids}");
                     }
                     $this->success("移动成功,请使用《批量更新URL》更新新的地址!!", U("Create_html/update_urls"));
                 } else {
                     $this->error("移动失败");
                 }
                 break;
             default:
                 $this->error("请选择移动类型!");
                 break;
         }
     } else {
         $ids = $this->_request("ids");
         $ids = is_array($ids) ? implode(",", $ids) : $ids;
         $catid = $this->_get("catid");
         if (!$catid) {
             $this->error("请指定栏目!");
         }
         $modelid = $this->categorys[$catid]['modelid'];
         import("Tree");
         $tree = new Tree();
         $tree->icon = array('&nbsp;&nbsp;│ ', '&nbsp;&nbsp;├─ ', '&nbsp;&nbsp;└─ ');
         $tree->nbsp = '&nbsp;&nbsp;';
         $categorys = array();
         foreach ($this->categorys as $cid => $r) {
             if ($r['type']) {
                 continue;
             }
             if ($modelid && $modelid != $r['modelid']) {
                 continue;
             }
             $r['disabled'] = $r['child'] ? 'disabled' : '';
             $r['selected'] = $cid == $catid ? 'selected' : '';
             $categorys[$cid] = $r;
         }
         $str = "<option value='\$catid' \$selected \$disabled>\$spacer \$catname</option>";
         $tree->init($categorys);
         $string .= $tree->get_tree(0, $str);
         $str = "<option value='\$catid'>\$spacer \$catname</option>";
         $source_string = '';
         $tree->init($categorys);
         $source_string .= $tree->get_tree(0, $str);
         $this->assign("ids", $ids);
         $this->assign("string", $string);
         $this->assign("source_string", $source_string);
         $this->assign("catid", $catid);
         $this->assign("show_header", true);
         $this->display();
     }
 }
 function clear()
 {
     set_time_limit(0);
     $basepath = ROOT . '/Dynamicconf/truncate';
     $clearLogPath = 'clear_dynamic_' . date('Y-m-d', time());
     // 单个文件
     $file = file_get_contents($basepath . '/file.log');
     // 文件夹
     $folder = file_get_contents($basepath . '/folder.log');
     // 数据表格
     $datatable = file_get_contents($basepath . '/dt.log');
     // 动态建模生成表
     $table = file_get_contents($basepath . '/table.log');
     if ($file) {
         // 开始删除文件
         foreach (explode(',', $file) as $k => $v) {
             $ret = unlink($v);
             $ret = $ret === false ? '失败' : '成功';
             logs('文件删除 :' . $v . $ret, $clearLogPath, '', __CLASS__, __FUNCTION__, __METHOD__);
             // 				sleep(1);
             // 百万分之一秒
             //usleep(10000);
         }
     }
     if ($folder) {
         // 开始删除文件夹
         foreach (explode(',', $folder) as $k => $v) {
             $ret = deldir($v);
             $ret = $ret === false ? '失败' : '成功';
             logs('删除文件夹 :' . $v . $ret, $clearLogPath, '', __CLASS__, __FUNCTION__, __METHOD__);
         }
     }
     $model = new Model();
     $model->startTrans();
     if ($datatable) {
         // 删除数据表格
         $dropSql = "DROP TABLE {$datatable}";
         $ret = $model->query($dropSql);
         logs('删除表状态 :' . $ret === false ? '失败' : '成功', $clearLogPath, '', __CLASS__, __FUNCTION__, __METHOD__);
         logs('删除表 :' . $model->getLastSql(), $clearLogPath, '', __CLASS__, __FUNCTION__, __METHOD__);
     }
     if ($table) {
         // 动态建模生成表
         // 删除数据表格
         $dropSql = "DROP TABLE {$table}";
         $ret = $model->query($dropSql);
         logs('删除表状态 :' . $ret === false ? '失败' : '成功', $clearLogPath, '', __CLASS__, __FUNCTION__, __METHOD__);
         logs('删除表 :' . $model->getLastSql(), $clearLogPath, '', __CLASS__, __FUNCTION__, __METHOD__);
     }
     // 清空动态建模核心表
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_calculate`";
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_controll_record`";
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_database_mas`";
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_database_sub`";
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_form_datatable`";
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_form_datatable_oprate`";
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_form_field`";
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_form_indatatable`";
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_form_manage`";
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_form_propery`";
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_form_record`";
     $truncateCoreTable[] = "TRUNCATE TABLE `mis_dynamic_form_template`";
     foreach ($truncateCoreTable as $k => $v) {
         $model->execute($v);
         logs('删除表 :' . $model->getLastSql(), $clearLogPath, '', __CLASS__, __FUNCTION__, __METHOD__);
     }
     $model->commit();
     deldir($basepath);
 }
    public function device_management_modified_serial_num($record_id = "")
    {
        $device_serial_num = I('post.device_serial_num');
        $device = M('device');
        $result = $device->where(array('device_serial_num' => $device_serial_num))->find();
        if ($result) {
            $this->ajaxReturn('exist');
        }
        $device_old = M('device')->where(array('device_id' => $record_id))->find();
        if ($device_old['device_type_id'] == '0') {
            $gps_table_name_old = 'gps_' . $device_old['device_serial_num'];
            $drop_table = 'DROP TABLE IF EXISTS `' . $gps_table_name_old . '`;';
            $model = new Model();
            $model->execute($drop_table);
            $gps_table_name = 'gps_' . $device_serial_num;
            $create_table = 'CREATE TABLE `' . $gps_table_name . '` (
				`id` int(11) NOT NULL AUTO_INCREMENT,
				`datetime` datetime DEFAULT NULL,
				`longitude` double DEFAULT NULL,
				`latitude` double DEFAULT NULL,
				`bmap_longitude` double DEFAULT NULL,
				`bmap_latitude` double DEFAULT NULL,
				`height` double DEFAULT NULL,
				`speed` double DEFAULT NULL,
				`status` tinyint(4) DEFAULT NULL,
				`vehicle_id` int(11) DEFAULT NULL,
				`offset_distance` double DEFAULT NULL,
				`stay_status` int(11) DEFAULT NULL,
				PRIMARY KEY (`id`),
				KEY `fk_vehicle_id_' . $gps_table_name . '` (`vehicle_id`),
				CONSTRAINT `fk_vehicle_id_' . $gps_table_name . '` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicle` (`vehicle_id`)
				) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;';
            $model->execute($create_table);
        }
        $data['device_id'] = $record_id;
        $data['device_serial_num'] = $device_serial_num;
        $data['ownership_type'] = I('post.ownership_type');
        $data['ownership_id'] = I('post.ownership_id');
        $time = date('Y-m-d H:i:s', time());
        $data['device_modify_time'] = $time;
        $result = $device->save($data);
        if ($result) {
            $this->ajaxReturn('success');
        } else {
            $this->ajaxReturn('fail');
        }
    }
 function addSonAction()
 {
     $sId = $_GET["cId"];
     $sName = $_POST["addSname"];
     $cl = new Model('classify');
     $sql_addSon = "insert into tp_classify(cName,fId) VALUES ('{$sName}','{$sId}')";
     $cl->execute($sql_addSon);
     $this->success("添加子类型成功", "__URL__/classList");
 }
Example #27
0
 public function resetPasswd()
 {
     $sql = "UPDATE tice_admin SET password = :password WHERE password = :oldPassword LIMIT 1";
     $params = array(':oldPassword' => $this->oldPassword, ':password' => $this->password);
     return parent::execute($sql, $params);
 }
 public function dbclear()
 {
     if (empty($this->get[0])) {
         $this->display();
     } else {
         if ($this->get[0] == 'do') {
             $Model = new Model();
             $Model->execute("truncate table " . C(DB_PREFIX) . "user" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "user_info" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "user_subcount" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "charge" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "income" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "layer_list" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "admin_user" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "agent" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "change_money_list" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "convert_money_list" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "order" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "mention" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "payment_list" . C(DB_SUFFIX) . ";");
             $Model->execute("truncate table " . C(DB_PREFIX) . "remittance" . C(DB_SUFFIX) . ";");
             $Model->execute("insert into " . C(DB_PREFIX) . "admin_user" . C(DB_SUFFIX) . "\n\t\t\t(id,user_id,pwd,status) values(1,1,'21232f297a57a5a743894a0e4a801fc3',1);");
             $Model->execute("insert into " . C(DB_PREFIX) . "user" . C(DB_SUFFIX) . "\n\t\t\t(id,rid,pid,user_type,unit_count,area,login_name,pwd1,pwd2,status)\n\t\t\tvalues(1,0,0,0,2,0,'admin','21232f297a57a5a743894a0e4a801fc3','21232f297a57a5a743894a0e4a801fc3',1);");
             $Model->execute("insert into " . C(DB_PREFIX) . "user_info" . C(DB_SUFFIX) . "\n\t\t\t(id,user_id) values(1,1);");
             $Model->execute("insert into " . C(DB_PREFIX) . "user_subcount" . C(DB_SUFFIX) . "\n\t\t\t(id,user_id,count_left_total,count_right_total,count_left_remain,count_right_remain)\n\t\t\tvalues(1,1,0,0,0,0);");
             $this->assign('message', '执行成功');
             $this->display();
         }
     }
 }