예제 #1
0
파일: msg.php 프로젝트: zxw5775/yuhunclub
 private function apollo($xml)
 {
     if (!$this->bind_check($xml)) {
         return;
     }
     $uid = $this->user_profile->id;
     $from = $xml->FromUserName;
     $to = $xml->ToUserName;
     if (!$uid) {
         $content = '请你先在懒投资微信“我的账户”—“绑定账号”中,绑定您的懒投资账号后,再回复净值关键字获取最新净值。';
     } else {
         // 从持仓账户里面取
         $infos = ApolloAccount::find(0, 10000, "user_id = '{$uid}' and balance > 0");
         if ($infos) {
             // 1. 已购买
             $in_status = array(ApolloProject::STATUS_REPAY, ApolloProject::STATUS_CLOSE);
             $now_date = date('Y-m-d H:i:s');
             $content = '小懒悄悄地告诉你~';
             foreach ($infos as $info) {
                 $prj_id = intval($info->project_id);
                 $prj_info = ApolloProject::get($prj_id);
                 if (!$prj_info) {
                     continue;
                 }
                 $title = trim($prj_info->title);
                 $price = ApolloPrice::get_latest_price_by_prj($prj_id);
                 $price = Money::hao2yuan($price);
                 $due_time = $prj_info->due_time;
                 $days = RepayUtil::days_diff($due_time, $now_date);
                 $tmp_txt = "你投资的“{$title}”当前净值是{$price},";
                 if ($days > 30 && in_array($prj_info->status, $in_status)) {
                     $available_amount = Money::fen2yuan($info->available_amount());
                     $tmp_txt .= "可出售{$available_amount}份。";
                 } else {
                     $tmp_txt .= "持有30天后即可开始转让。";
                 }
                 $arr_text[] = $tmp_txt;
             }
             $text = implode("\n", $arr_text);
             if (count($arr_text) > 0) {
                 $content .= "\n" . $text;
             } else {
                 $content .= $text;
             }
         } else {
             // 2. 未购买 获取最大净值的项目
             $res = ApolloPrice::get_highest_price_prj();
             if ($res) {
                 $price = intval($res->price);
                 $prj_id = intval($res->project_id);
                 $prj = ApolloProject::get($prj_id);
             } else {
                 // 取不到,则
                 $in_status = array(ApolloProject::STATUS_OPEN, ApolloProject::STATUS_DUE, ApolloProject::STATUS_REPAY, ApolloProject::STATUS_CLOSE);
                 $in_str = Db::build_in_string($in_status);
                 $prj = ApolloProject::find_one("status in ({$in_str})", 'id desc');
                 $price = intval($prj->price);
             }
             if ($prj) {
                 $title = trim($prj->title);
                 $price = Money::hao2yuan($price);
                 $content = "小懒悄悄地告诉你~当前群星计划中,“{$title}”净值最高,目前净值{$price}。快来投资吧~";
             } else {
                 $content = "小懒悄悄地告诉你~当前群星计划中,“群星1号新能源精选”净值最高,目前净值1.0013。快来投资吧~";
             }
         }
     }
     $this->wx_reply->imm_reply_text($to, $from, $content);
 }
예제 #2
0
</thead>
<tbody>
<?php 
foreach ($ds['items'] as $m) {
    ?>
	<tr>
		<td><?php 
    echo $m->contract_name;
    ?>
</td>
		<td><?php 
    echo $m->status_text();
    ?>
</td>
		<td><?php 
    echo Money::fen2yuan($m->pay_amount);
    ?>
</td>
		<td><?php 
    echo $m->threshold;
    ?>
%</td>
		<td><?php 
    echo $m->create_time;
    ?>
</td>
		<td>
			<a onClick="if(confirm('确认删除?'))return true;return false;" href="<?php 
    echo _action('del', array('id' => $m->id));
    ?>
">删除</a>
예제 #3
0
		<ul class="nav navbar-nav navbar-right">
			<li>
				<a class="" href="<?php 
echo _url('admin/logout');
?>
" data-toggle="">退出</a>
			</li>
		</ul>
	</div>
</div>

<?php 
if ($_SESSION['admin_user']) {
    $real_data = RealData::get_cache();
    if ($real_data) {
        echo "ASHR 行情:更新时间:{$real_data['date']} 价格:" . Money::fen2yuan($real_data['amount']);
    }
}
?>

<div class="container">
	<?php 
_view();
?>
		
	<div class="footer">
		Copyright&copy;2014 www.axelahome.com. All rights reserved.
		<?php 
printf('%.2f', 1000 * (microtime(1) - APP_TIME_START));
?>
 ms
예제 #4
0
</thead>
<tbody>
<?php 
foreach ($ds as $m) {
    ?>
	<tr>
		<td><?php 
    echo $m->name;
    ?>
</td>
		<td><?php 
    echo Money::fen2yuan($m->strike_amount);
    ?>
</td>
		<td><?php 
    echo Money::fen2yuan($m->ask_amount);
    ?>
</td>
		<td><?php 
    echo $m->level_10;
    ?>
</td>
		<td><?php 
    echo $m->level_15;
    ?>
</td>
		<td><?php 
    echo $m->level_20;
    ?>
</td>
	</tr>
예제 #5
0
    ?>
</td>
		<td><?php 
    echo Money::fen2yuan($m->last_amount);
    ?>
</td>
		<td><?php 
    echo Money::fen2yuan($m->bid_amount);
    ?>
</td>
		<td><?php 
    echo Money::fen2yuan($m->ask_amount);
    ?>
</td>
		<td><?php 
    echo Money::fen2yuan($m->change_amount);
    ?>
</td>
		<td><?php 
    echo $m->change_rate;
    ?>
%</td>
		<td><?php 
    echo $m->volume;
    ?>
</td>
		<td><?php 
    echo $m->open_interest;
    ?>
</td>
		<td><?php