phpjavascript資料
php代碼
function one($type='OfferGetAllOfferList',$start,$pagesize=10,$total=100) { $next=$start+1; if($start*$pagesize<=$total) { $this->outData['next'] = $next; $this->outData['pagesize'] = $pagesize; $this->outData['type'] = $type; $this->outData['total'] = $total; $this->output(); } elseif($type == 'OfferGetAllOfferList' && $start*$pagesize>$total) { $this->outData['next'] = $next; $this->outData['pagesize'] = $pagesize; $this->outData['type'] = 'TradeOrderListGet'; $this->outData['total'] = $total; $this->output(); }elseif($type == 'TradeOrderListGet' && $start*$pagesize>$total) { $this->outData['next'] = $next; $this->outData['pagesize'] = $pagesize; $this->outData['type'] = 'MemberGet'; $this->outData['total'] = $total; $this->output(); }else { echo "同步完成"; exit; } }
,
js代碼
問題:
$type預設是OfferGetAllOfferList,當$start*$pagesize大於100時執行elseif($type == 'OfferGetAllOfferList' && $start*$pagesize>$total)裡面的代碼,$start歸1。
$start*$pagesize大於100時執行elseif($type == 'TradeOrderListGet' && $start*$pagesize>$total)裡面的代碼,結果歸1。
最後輸出“同步完成”。
遇到的問題就是第一個if執行完怎麼把$start歸1繼續往底下執行?