当前位置: 首页>>代码示例>>PHP>>正文


PHP team_state函数代码示例

本文整理汇总了PHP中team_state函数的典型用法代码示例。如果您正苦于以下问题:PHP team_state函数的具体用法?PHP team_state怎么用?PHP team_state使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了team_state函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: OnlineIt

 public static function OnlineIt($order_id, $pay_id, $money, $currency = 'CNY', $service = 'alipay', $bank = '支付宝', $trade_no = '')
 {
     list($_, $_, $quantity, $_) = explode('-', $pay_id);
     if (!$order_id || !$pay_id || $money <= 0) {
         return false;
     }
     $order = Table::Fetch('order', $order_id);
     $team = Table::Fetch('team', $order['team_id']);
     $user_id = abs(intval($order['user_id']));
     team_state($team);
     if ($order['state'] == 'unpay') {
         $table = new Table('pay');
         $table->id = $pay_id;
         $table->vid = $trade_no;
         $table->order_id = $order_id;
         $table->money = $money;
         $table->currency = $currency;
         $table->bank = $bank;
         $table->service = $service;
         $table->create_time = time();
         $ia = array('id', 'vid', 'order_id', 'money', 'currency', 'service', 'create_time', 'bank');
         if (Table::Fetch('pay', $pay_id) || !$table->insert($ia)) {
             return false;
         }
         //update user money; +money
         Table::UpdateCache('user', $user_id, array('money' => array("money + {$money}")));
         $u = array('user_id' => $user_id, 'admin_id' => 0, 'money' => $money, 'direction' => 'income', 'action' => 'paycharge', 'detail_id' => $pay_id, 'create_time' => time());
         DB::Insert('flow', $u);
         $user = Table::FetchForce('user', $user_id);
         //print_r($user);exit;
         if ($user['money'] < $order['origin']) {
             return false;
         }
         if (in_array($team['state'], array('soldout')) || $team['end_time'] < time()) {
             return false;
         }
         Table::UpdateCache('order', $order_id, array('pay_id' => $pay_id, 'money' => $money, 'state' => 'pay', 'trade_no' => $trade_no, 'service' => $service, 'quantity' => $quantity, 'pay_time' => time()));
         $order = Table::FetchForce('order', $order_id);
         if ($order['state'] == 'pay') {
             //TeamBuy Operation
             ZTeam::BuyOne($order);
         }
     }
     return true;
 }
开发者ID:norain2050,项目名称:zuituware,代码行数:45,代码来源:ZOrder.class.php

示例2: floor

if ( $team['team_type'] == 'seconds' && $team['begin_time'] >= $now ) {
	$diff_time = $left_time = $team['begin_time']-$now;
}

$left_day = floor($diff_time/86400);
$left_time = $left_time % 86400;
$left_hour = floor($left_time/3600);
$left_time = $left_time % 3600;
$left_minute = floor($left_time/60);
$left_time = $left_time % 60;

/* progress bar size */
$bar_size = ceil(190*($team['now_number']/$team['min_number']));
$bar_offset = ceil(5*($team['now_number']/$team['min_number']));
$partner = Table::Fetch('partner', $team['partner_id']);
$team['state'] = team_state($team);

/* your order */
if ($login_user_id && 0==$team['close_time'] ) {
	$order = DB::LimitQuery('order', array(
				'condition' => array(
					'team_id' => $id,
					'user_id' => $login_user_id,
					'state' => 'unpay',
					'rstate' => 'normal',
					),
				'one' => true,
				));
}
/* end order */
开发者ID:noikiy,项目名称:mdwp,代码行数:30,代码来源:team.php

示例3: if

			'offset' => $offset 
	) );
} else if ($selector == 'askrefund') {
	// 退款列表协议,修正最土退款订单列表问题
	$condition [] = '(allowrefund = "Y" AND state = "pay") OR (state = "unpay" AND allowrefund = "Y" AND rstate = "berefund")';
	$count = Table::Count ( 'order', $condition );
	list ( $pagesize, $offset, $pagestring ) = pagestring ( $count, 10 );
	$orders = DB::LimitQuery ( 'order', array (
			'condition' => $condition,
			'order' => 'ORDER BY team_id DESC, id ASC',
			'size' => $pagesize,
			'offset' => $offset 
	) );
}

$team_ids = Utility::GetColumn ( $orders, 'team_id' );
$teams = Table::Fetch ( 'team', $team_ids );
foreach ( $teams as $tid => $one ) {
	team_state ( $one );
	$teams [$tid] = $one;
}

$apply_ids = Utility::GetColumn ( $orders, 'apply_id' );
$applys = Table::Fetch ( 'apply', $apply_ids );

// 标记是否可以点评 
$orders = markOrderListDp ( $orders, $teams );

$pagetitle = '我的订单';
include template ( 'order_index' );
开发者ID:noikiy,项目名称:mdwp,代码行数:30,代码来源:index.php

示例4: if

			             	  <?php } else { ?>
                              <h2>进行中的团购项目</h2>
				<?php }?>
					<ul class="filter">
						<li><?php echo !$team_type ? '全部' : '<a href="?">全部</a>'; ?></li>
						<li><?php echo $team_type=='normal' ? '团购' : '<a href="?team_type=normal">团购</a>'; ?></li>
						<li><?php echo $team_type=='seconds' ? '秒杀' : '<a href="?team_type=seconds">秒杀</a>'; ?></li>
						<li><?php echo $team_type=='goods' ? '商品' : '<a href="?team_type=goods">商品</a>'; ?></li>
					</ul>
				</div>
                <div class="sect">
					<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
					<tr><th width="40">ID</th><th width="400">项目名称</th><th width="80" nowrap>类别</th><th width="100">日期</th><th width="50">成交</th><th width="60" nowrap>价格</th><th width="140">操作</th></tr>
					<?php if(is_array($teams)){foreach($teams AS $index=>$one) { ?>
					<?php $oldstate = $one['state']; ?>
					<?php $one['state'] = team_state($one); ?>
					<tr <?php echo $index%2?'':'class="alt"'; ?> id="team-list-id-<?php echo $one['id']; ?>">
						<td>ID:
						  <?php echo $one['id']; ?><br />
XH:
<?php echo $one['sort_order']; ?></a></a></td>
						<td>
							<?php echo $one['team_type']=='normal' ? '[团购]' : ''; ?>
							<?php echo $one['team_type']=='seconds' ? '[秒杀]' : ''; ?>
							<?php echo $one['team_type']=='goods' ? '[商品]' : ''; ?>
							<a class="deal-title" href="/team.php?id=<?php echo $one['id']; ?>" target="_blank"><?php echo $one['title']; ?></a>
						</td>
						<td nowrap><?php echo $cities[$one['city_id']]['name']; ?><br/><?php echo $groups[$one['group_id']]['name']; ?></td>
						<td nowrap><?php echo date('Y-m-d',$one['begin_time']); ?><br/><?php echo date('Y-m-d',$one['end_time']); ?></td>
						<td nowrap><?php echo $one['now_number']; ?>/<?php echo $one['min_number']; ?></td>
						<td nowrap><span class="money"><?php echo $currency; ?></span><?php echo moneyit($one['team_price']); ?><br/><span class="money"><?php echo $currency; ?></span><?php echo moneyit($one['market_price']); ?></td>
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:manage_team_dsj.php

示例5: state_explain

function state_explain($team, $error = 'false')
{
    $state = team_state($team);
    $state = strtolower($state);
    switch ($state) {
        case 'none':
            return '正在进行中';
        case 'soldout':
            return '已售光';
        case 'failure':
            if ($error) {
                return '团购失败';
            }
        case 'success':
            return '团购成功';
        default:
            return '已结束';
    }
}
开发者ID:yunsite,项目名称:e-tuan001-com,代码行数:19,代码来源:TeamAction.class.php

示例6: elseif

         }
     } elseif ($category['zone'] == 'public') {
         $tcount = Table::Count('topic', array('public_id' => $id));
         if ($tcount) {
             json('本类下存在讨论区话题', 'alert');
         }
     }
     Table::Delete('category', $id);
     option_category($category['zone']);
     Session::Set('notice', '删除分类成功');
     json(null, 'refresh');
 } else {
     if ('teamcoupon' == $action) {
         need_auth('team');
         $team = Table::Fetch('team', $id);
         team_state($team);
         if ($team['now_number'] < $team['min_number']) {
             json('团购未结束或未达到最低成团人数', 'alert');
         }
         /* all orders */
         $all_orders = DB::LimitQuery('order', array('condition' => array('team_id' => $id, 'state' => 'pay')));
         $all_orders = Utility::AssColumn($all_orders, 'id');
         $all_order_ids = Utility::GetColumn($all_orders, 'id');
         $all_order_ids = array_unique($all_order_ids);
         /* all coupon id */
         $coupon_sql = "SELECT order_id, count(1) AS count FROM coupon WHERE team_id = '{$id}' GROUP BY order_id";
         $coupon_res = DB::GetQueryResult($coupon_sql, false);
         $coupon_order_ids = Utility::GetColumn($coupon_res, 'order_id');
         $coupon_order_ids = array_unique($coupon_order_ids);
         /* miss id */
         $miss_ids = array_diff($all_order_ids, $coupon_order_ids);
开发者ID:hhdem,项目名称:tuangala_v2,代码行数:31,代码来源:manage.php

示例7: foreach

?>
" >&nbsp;&nbsp;<input type="submit" value="筛选" class="formbutton"  style="padding:1px 6px;"/></p>
					<form>
				</div>
                <div class="sect">
					<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
					<tr><th width="40">ID</th><th width="400">项目名称</th><th width="80" nowrap>类别</th><th width="100">日期</th><th width="50">成交</th><th width="60" nowrap>价格</th><th width="140">操作</th></tr>
					<?php 
if (is_array($teams)) {
    foreach ($teams as $index => $one) {
        ?>
					<?php 
        $oldstate = $one['state'];
        ?>
					<?php 
        $one['state'] = team_state($one);
        ?>
					<tr <?php 
        echo $index % 2 ? '' : 'class="alt"';
        ?>
 id="team-list-id-<?php 
        echo $one['id'];
        ?>
">
						<td><?php 
        echo $one['id'];
        ?>
</a></td>
						<td>
							<?php 
        echo $one['team_type'] == 'normal' ? '[团购]' : '';
开发者ID:norain2050,项目名称:zuituware,代码行数:31,代码来源:manage_team_index.php

示例8: array

	}
/***********************加入的代码:结束*********************************/
/***********************加入的代码:开始*********************************/
$condition = array(
			'team_type in ("normal","seconds")', 
			"begin_time < '{$anow}'",
			"end_time > '{$anow}'",
			'big_index' => 'Y',
			);
$inter_teams = DB::LimitQuery('team', array(
				'condition' => $condition,
				'order' => 'ORDER BY `sort_order` DESC, `id` DESC',
				'size' => 2,
				));
foreach($inter_teams AS $key=>$value){
	$inter_teams[$key]['state'] = team_state($value);
}
/***********************加入的代码:结束*********************************/

/**
 * 热门商圈
 */
$hot_area_cond = array();
$hot_area_cond['zone'] = 'bizarea';
$hot_area_cond[] = "fid > 0";
$hot_area_cond[] = "hot_order > 0";
$hotAreaBizList = DB::LimitQuery('category',array(
	'condition'=>$hot_area_cond,
	'size'=>11,
	'order'=>'order by hot_order desc'
)); 
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:index.php


注:本文中的team_state函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。