예제 #1
0
function check_status($id1, $id2)
{
    if ($id1 == 0 || $id2 == 0) {
        return 0;
        // not in session
    } else {
        if (return_status($id1, $id2) == 1) {
            return 1;
            //friend already
        } else {
            if (return_status($id2, $id1) == 1) {
                return 1;
                //friend already
            } else {
                if (return_status($id1, $id2) == 0) {
                    return 2;
                    // friend request recieved;
                } else {
                    if (return_status($id2, $id1) == 0) {
                        return 3;
                        // friend request send
                    } else {
                        return 4;
                        // no previous connections
                    }
                }
            }
        }
    }
}
예제 #2
0
	/**
	 * 更新订单状态
	 * @param unknown_type $trade_sn 订单ID
	 * @param unknown_type $status 订单状态
	 */
	private function update_recode_status_by_sn($trade_sn,$status) {
		$trade_sn = trim($trade_sn);
		$status = trim(intval($status));
		$data = array();
		$this->account_db = pc_base::load_model('pay_account_model');
		$status = return_status($status);
		$data = array('status'=>$status);
		return $this->account_db->update($data,array('trade_sn'=>$trade_sn));
	}