Exemple #1
0
 /**
  * 失败的赞助
  */
 public function actionFitTenderTradeno()
 {
     if (!isset($_POST['tender_id']) || !isset($_POST['trade_no'])) {
         $status = array('status' => 0, "info" => '用户名或者密码错误!');
         echo json_encode($status);
         Yii::app()->end();
     }
     #更改赞助信息的状态
     $result = Tender::model()->updateByPk($_POST['tender_id'], array("trade_no" => $_POST['trade_no']), "user_id=:user_id AND status=0", array(":user_id" => Yii::app()->user->getId()));
     if ($result) {
         $status = array('status' => 1, "info" => '提交成功');
     } else {
         $status = array('status' => 0, "info" => '提交失败');
     }
     echo json_encode($status);
     Yii::app()->end();
 }
 /**
  * 处理信用筹资的状态
  */
 public function actionFittenderstatus()
 {
     if (isset($_REQUEST['id']) && isset($_REQUEST['lunbo_id']) && isset($_REQUEST['status'])) {
         #直接更改属于这个人的数据
         #获得当前项目的拥有人
         $thisproject = Project::model()->findByPk($_REQUEST['id'], "user_id=:user_id", array(":user_id" => Yii::app()->user->getId()));
         if ($thisproject) {
             #查询是否存在这个筹资记录
             $thistender = Tender::model()->findByPk($_REQUEST['lunbo_id'], "project_id=:project_id", array(":project_id" => $thisproject->id));
             if ($thistender) {
                 //处理淘宝项目跟别的不一样
                 if ($thisproject->type == 3) {
                     $addip = Yii::app()->request->userHostAddress;
                     $user_id = Yii::app()->user->getId();
                     try {
                         $conn = Yii::app()->db;
                         $command = $conn->createCommand('call p_Fit_TaoBao_Tender(:user_id,:tender_id,:in_addip,@out_status,@out_remark)');
                         $command->bindParam(":user_id", $user_id, PDO::PARAM_INT);
                         $command->bindParam(":tender_id", $thistender->id, PDO::PARAM_INT);
                         $command->bindParam(":in_addip", $addip, PDO::PARAM_STR, 50);
                         $command->execute();
                         $result = $conn->createCommand("select @out_status as status,@out_remark as remark")->queryRow(true);
                         if ($result['status'] == 1) {
                             echo 1;
                         } else {
                             echo $result['remark'];
                         }
                     } catch (Exception $e) {
                         echo '系统繁忙,暂时无法处理';
                     }
                 } else {
                     $result = Tender::model()->updateByPk($_REQUEST['lunbo_id'], array("status" => $_REQUEST['status']));
                     #如果所有都处理完了,那么更新这个项目为成功的
                     if ($result) {
                         $nums = Tender::model()->count("project_id=:project_id AND status=0", array(":project_id" => $thisproject->id));
                         if ($nums == 0) {
                             Project::model()->updateByPk($thisproject->id, array("status" => 3));
                         }
                         echo 1;
                     } else {
                         echo '错误的操作';
                     }
                 }
             } else {
                 echo '错误的操作';
             }
         } else {
             echo '错误的操作';
         }
     } else {
         echo '错误的操作';
     }
     Yii::app()->end();
 }
Exemple #3
0
<?php

if (isset($page)) {
    $page = intval($page);
} else {
    $page = 1;
}
if (isset($id)) {
    #获得筹资记录
    $thisproject = Project::model()->findByPk($id, "user_id=:user_id", array(":user_id" => Yii::app()->user->getId()));
    if ($thisproject) {
        $startlog = ($page - 1) * 15;
        $thischoujilu = Tender::model()->findAll("project_id=:project_id order by id asc limit :startlog,15 ", array(":project_id" => intval($id), ":startlog" => $startlog));
        if ($thischoujilu) {
            ?>
            <table class="table table-bordered table-striped">
                <tr>
                    <th>序号</th>
                    <th>赞助资金</th>
                    <th>赞助类型</th>
                    <th>用户名</th>
                    <th>赞助时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                <?php 
            foreach ($thischoujilu as $value) {
                ?>
                    <tr>
                        <td><?php 
                echo $value->id;
<?php

switch ($data['modelName']) {
    case "Transport":
        Transport::disableDefaultScope();
        $model = Transport::model('Transport')->findByPk($data['key']);
        echo $this->renderPartial('application.views.transport._view', array('data' => $model));
        break;
    case "Cargo":
        Cargo::disableDefaultScope();
        $model = Cargo::model()->findByPk($data['key']);
        echo $this->renderPartial('application.views.cargo._view', array('data' => $model));
        break;
    case "Tender":
        $model = Tender::model()->findByPk($data['key']);
        echo $this->renderPartial('application.views.tender._view', array('data' => $model));
        break;
    case "User":
        $model = User::model()->findByPk($data['key']);
        echo $this->renderPartial('application.views.user._view', array('data' => $model));
        break;
    default:
        echo "Не правильные данные обратитесь к администратору.";
}
Exemple #5
0
                    <div class="panel-heading qys_panel_heading_title">
                        <h5 class="panel-title qys_details_panel_title">
                            <strong>使用记录</strong>
                        </h5>
                    </div>
                    <div class="panel-body">
                        暂无记录
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
<?php 
$thischoujilutotal = Tender::model()->count("project_id=:project_id", array(":project_id" => $oneProject->id));
if ($thischoujilu) {
    ?>
        $('#pagination-zhoulog').twbsPagination({
            totalPages: <?php 
    echo $thischoujilu ? ceil($thischoujilutotal / 10) : 0;
    ?>
,
            visiblePages: 1,
            href: '/project/tenders/id/<?php 
    echo $oneProject->id;
    ?>
/choulog/page/{{number}}.html',
            onPageClick: function (event, page) {
                $.ajax({
                    url: '/project/tenders/id/<?php