/** * 成功筹资的管理 */ public function actionManage() { #获得是否存在项目 if (!isset($_REQUEST['id'])) { $errorarray = array(0 => 'fail', 1 => '错误的操作!', 2 => 'reurl', 3 => Yii::app()->request->urlReferrer, 4 => '/notice/errors.html'); //跳转到错误的页面 parent::toUrl($errorarray); } $thisproject = Project::model()->findByPk($_REQUEST['id'], "user_id=:user_id AND (status=3 OR type=3)", array(":user_id" => Yii::app()->user->getId())); $oneprojectuse = new ProjectUse(); if (!$thisproject) { $errorarray = array(0 => 'fail', 1 => '错误的操作!', 2 => 'reurl', 3 => Yii::app()->request->urlReferrer, 4 => '/notice/errors.html'); //跳转到错误的页面 parent::toUrl($errorarray); } $error = ""; if (isset($_POST['ProjectUse']) && $thisproject->type != 3) { //项目修改处理 $oneprojectuse->setAttributes($_POST['ProjectUse']); if ($thisproject->collection_type == 0) { $oneprojectuse->setAttribute("status", 1); } $oneprojectuse->setAttribute("project_id", $thisproject->id); $oneprojectuse->setAttribute("addtime", time()); $oneprojectuse->setAttribute("addip", Yii::app()->request->userHostAddress); $oneprojectuse->setAttribute("user_id", Yii::app()->user->getId()); if ($oneprojectuse->validate()) { $oneprojectuse->qys_save(); } } if ($thisproject->type == 3) { $this->render('manage_taobao', array("thisproject" => $thisproject, 'oneprojectuse' => $oneprojectuse, "editer_error" => $error)); } else { $this->render('manage', array("thisproject" => $thisproject, 'oneprojectuse' => $oneprojectuse, "editer_error" => $error)); } }
<div class="table-responsive"> <table class="table table-bordered table-striped" style="border-top:none;"> <tr> <td colspan=6 style="border-top:none;"></td> </tr> <tr> <th>序号</th> <th>使用资金</th> <th>用途</th> <th>赞同率</th> <th>添加时间</th> <th>状态</th> </tr> <?php #获得已经使用的用途 $thisprojcetlunbopics = ProjectUse::model()->findAll("project_id=:projects_id order by id asc", array(":projects_id" => $thisproject->id)); if ($thisprojcetlunbopics) { foreach ($thisprojcetlunbopics as $value) { ?> <tr> <td><?php echo $value->id; ?> </td> <td><?php echo $value->money; ?> </td> <td><?php echo $value->remark; ?>