/** * 保存用户的银行卡或者更改 * @param Bankcard $bankCard * @param type $user_id * @return \Bankcard */ public static function saveBankCard(Bankcard $bankCard, $user_id) { $_POST['Bankcard']['bank'] = 'xx'; if (isset($_POST['bank'])) { $_POST['Bankcard']['bank'] = $_POST['bank']; $bank = Linkage::getValueChina($_POST['bank'], "account_bank"); if ($bank) { $_POST['Bankcard']['bank_name'] = $bank; } } $_POST['Bankcard']['bank_type'] = 'xx'; if (isset($_POST['bank_type'])) { $_POST['Bankcard']['bank_type'] = $_POST['bank_type']; } $_POST['Bankcard']['area'] = '0'; if (isset($_POST['province'])) { $_POST['Bankcard']['province'] = $_POST['province']; } if (isset($_POST['city'])) { $_POST['Bankcard']['city'] = $_POST['city']; } $_POST['Bankcard']['user_id'] = $user_id; $bankCard->setAttributes($_POST['Bankcard']); foreach ((array) $_POST['Bankcard'] as $key => $value) { if (trim($value) == '') { $bankCard->addError($key, "字段不能为空"); break; } } if (!$bankCard->getErrors()) { $bankCard->setAttribute('addtime', time()); $bankCard->setAttribute('addip', Yii::app()->request->userHostAddress); if ($bankCard->validate()) { if ($bankCard->isNewRecord) { $result = $bankCard->save(); } else { $result = $bankCard->update(); } if (!$result) { $bankCard->addError("realname", "更新失败"); } } else { $bankCard->addError("realname", "更新失败"); } } return $bankCard; }
/** * 处理筹资类型 */ public static function getCollectionValue($value = null) { return Linkage::getValueChina($value, "collection_type"); }
<td class="qys_publish_td_left">资金详情:</td> <td class="qys_publish_td_right">总筹资金额 <span id="total_money" style="color:green;font-size: 15px;font-weight: 900;">50</span> 元,担保金额 <span id="total_danbao" style="color:red;font-size: 15px;font-weight: 900;">105</span> 元。</td> </tr> <tr> <td class="qys_publish_td_left">筹资地区限制:</td> <td class="qys_publish_td_right"> <?php echo CHtml::dropDownList("area_limit", "1", Linkage::getValueChina("qys_none", "area_limit"), array("class" => "input_select")); ?> <input id="publish_iplimit" name="iplimit" class="input_account" type="text" value="1"/><span class="qys_publish_dec">个人</span></td> </tr> <tr> <td class="qys_publish_td_left">筹资期限:</td> <td class="qys_publish_td_right"> <?php echo CHtml::dropDownList("intime", "1", Linkage::getValueChina("qys_none", "collection_day"), array("class" => "input_select")); ?> <span class="qys_publish_dec">需在多少天内完成筹资</span></td> </tr> <tr> <td class="qys_publish_td_left">最低筹资:</td> <td class="qys_publish_td_right"> <?php echo CHtml::dropDownList("low_account", "50", Project::getLowAccountLimitValue(), array("class" => "input_select", "disabled" => true)); ?> <span class="qys_publish_dec">每人最低需筹资的金额</span></td> </tr> <tr> <td class="qys_publish_td_left">形象图片:</td> <td class="qys_publish_td_right"> <div class="form-group">
?> </div> <label class="control-label col-lg-7" style="text-align: left;">筹资项目所属的类型</label> </div><!-- /.form-group --> </td> </tr> <tr> <td class="qys_publish_td_left">筹资方式:</td> <td class="qys_publish_td_right"> <div class="form-group"> <div class="col-lg-5"> <?php if ($thisproject->type = 3) { echo Linkage::getValueChina($thisproject->collection_type, "collection_type"); } else { echo $form->dropDownList($thisproject, 'collection_type', Linkage::getValueChina("qys_none", "collection_type"), array('class' => 'form-control')); } ?> </div> <label class="control-label col-lg-7" style="text-align: left;">筹资时是否直接冻结用户资金</label> </div><!-- /.form-group --> </td> </tr> <tr> <td class="qys_publish_td_left">筹资金额:</td> <td class="qys_publish_td_right"> <div class="form-group"> <div class="col-lg-5"> <?php if ($thisproject->type = 3) { echo $thisproject->account;
/** * * @param type $value * @return string * 获得问答分类类型 */ public static function getMessage($value = "qys_none") { $questid = LinkageType::model()->find("ename='message'"); if ($value === "qys_none") { $result = Yii::app()->db->createCommand("select eaname,cvalue from {{linkage}} where type_id=" . $questid->id)->queryAll(true); if ($result) { $newarray = array(); foreach ($result as $key => $value) { $newarray[$value['cvalue']] = $value['eaname']; } return $newarray; } else { return array("1" => '无数据'); } } else { $result = Linkage::model()->find("type_id=:type_id AND cvalue=:cvalue", array(":type_id" => $questid->id, ":cvalue" => $value)); if (!$result) { return ''; } else { return $result->eaname; } } # }
<div class="col-lg-12" style="padding:10px 25px 0px 25px;"> <div class="panel panel-default" style="margin-bottom: 0px;"> <div class="panel-body"> <?php if ($bankCard->getErrors()) { $errors = $bankCard->getErrors(); echo '<div>' . $errors[0][0] . '</div>'; } ?> <?php $form = $this->beginWidget('CActiveForm', array('id' => 'channel-form', 'enableAjaxValidation' => false, 'enableClientValidation' => false)); ?> <div class="form-group"> <label for="exampleInputEmail1">所属银行</label> <?php echo QCHtml::dropDownList("bank", "2", Linkage::getValueChina("qys_none", "account_bank"), array("class" => "form-control")); ?> </div> <div class="form-group"> <label for="exampleInputEmail1">帐号类型</label> <?php echo QCHtml::dropDownList("bank_type", $bankCard->bank_type, $bankCard::getBankType(), array("class" => "form-control")); ?> </div> <div class="form-group"> <label for="exampleInputPassword1">真实姓名</label> <?php echo $form->textField($bankCard, 'realname', array('class' => 'form-control text-center', 'placeholder' => '请输入开户银行的真实姓名', 'maxlength' => 50)); ?> </div> <div class="form-group">
<div class="col-lg-5"> <?php echo $form->textField($thisbank, 'account', array('class' => 'form-control')); ?> </div> <label class="control-label col-lg-7" style="text-align: left;"><font style="color:red;">*</font> 请填写你的银行帐号(不允许有空格)</label> </div><!-- /.form-group --> </td> </tr> <tr> <td class="qys_publish_td_left">帐号类型:</td> <td class="qys_publish_td_right"> <div class="form-group"> <div class="col-lg-5"> <?php echo $form->dropDownList($thisbank, 'bank_type', Linkage::getValueChina("qys_none", "bank_type"), array('class' => 'form-control')); ?> </div> <label class="control-label col-lg-7" style="text-align: left;"><font style="color:red;">*</font> 选择您的银行是私人或者公司</label> </div><!-- /.form-group --> </td> </tr> <tr> <td class="qys_publish_td_left">开户所在地:</td> <td class="qys_publish_td_right"> <div class="form-group"> <div class="col-lg-12"> <table style="width:100%;padding:5px;"> <tr> <td style="padding:5px;"> <?php
<?php foreach ($dataProvider->getData() as $value) { ?> <tr> <td><?php echo $value->id; ?> </td> <td> <?php echo $value->money; ?> </td> <td> <?php echo Linkage::getValueChina($value->project->collection_type, "collection_type"); ?> </td> <td> <?php echo $value->user->username; ?> </td> <td> <?php echo date("Y/m/d H:i:s", $value->addtime); ?> </td> <td> <?php echo $value->trade_no;
<td class="qys_publish_td_left">答案:</td> <td class="qys_publish_td_right"> <div class="form-group"> <div class="col-lg-5"> <?php echo QCHtml::textField("Users[answer]", '', array('class' => 'form-control')); ?> </div> <label class="control-label col-lg-7" style="text-align: left;"><font style="color:red;">*</font> 填写您的答案</label> </div><!-- /.form-group --> </td> </tr> <tr> <td class="qys_publish_td_left">已往问题:</td> <td class="qys_publish_td_right"><?php echo Linkage::getQuestion($thisuser->question); ?> </td> </tr> <tr> <td class="qys_publish_td_left">已往答案:</td> <td class="qys_publish_td_right"> <div class="form-group"> <div class="col-lg-5"> <?php echo QCHtml::textField("Users[oldanswer]", '', array('class' => 'form-control')); ?> </div> <label class="control-label col-lg-7" style="text-align: left;"><font style="color:red;">*</font>如果没有,请输入与当前一样的答案</label> </div><!-- /.form-group --> </td>
foreach ($dataProvider->getData() as $value) { ?> <tr> <td><?php echo $value->id; ?> </td> <td title="<?php echo $value->title; ?> "><?php echo BaseTool::truncate_utf8_string($value->title, 8); ?> </td> <td><?php echo Linkage::getMessage($value->type_id); ?> </td> <td><?php echo $value->remark; ?> </td> <td><?php echo $value->value; ?> </td> <td><?php echo date("Y-m-d H:i:s", $value->addtime); ?> </td> </tr>
<td><span class="qys_little_number"><strong><?php echo $oneProject->account_yes / $oneProject->account_one; ?> </strong></span><small class="qys_little_style"> 次 </small></td> </tr> <tr> <td>每次收益</td> <td><span class="qys_little_number"><strong><?php echo $oneProject->account_lixi; ?> </strong></span><small class="qys_little_style"> 元 </small></td> </tr> <tr> <td>筹资方式</td> <td><span class="qys_little_number"><strong><?php echo Linkage::getValueChina($oneProject->collection_type, "collection_type"); ?> </strong></td> </tr> <tr> <td>范围限制</td> <?php $arealimitname = "省份"; switch ($oneProject->area_limit) { case 1: $arealimitname = "省份"; break; case 2: $arealimitname = "城市"; break; case 3: