當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。