function checkprintcard($ebay_id) { global $dbcon, $SYSTEM_ACCOUNTS; $ebay_id = intval($ebay_id); $sql = "SELECT ebay_orderid,ebay_userid,ebay_carrier,ebay_account,recordnumber FROM ebay_order WHERE ebay_id={$ebay_id} AND ebay_combine!=1 LIMIT 1"; $sql = $dbcon->execute($sql); $mainorder = $dbcon->fetch_one($sql); if (empty($mainorder)) { return ''; } if (!in_array($mainorder['ebay_carrier'], array('中国邮政挂号', '中国邮政平邮', '香港小包挂号', '香港小包平邮', 'EUB'))) { return ''; } if (in_array($mainorder['ebay_account'], $SYSTEM_ACCOUNTS['ebay平台']) && empty($mainorder['ebay_orderid'])) { return ''; } if (!in_array($mainorder['ebay_account'], $SYSTEM_ACCOUNTS['ebay平台']) && preg_match("/[a-z]+/i", $mainorder['recordnumber'])) { return ''; } if ($mainorder['ebay_account'] == 'dresslink.com') { return ''; } $sql = "SELECT ebay_street FROM ebay_order WHERE ebay_userid='{$mainorder['ebay_userid']}' AND ebay_combine!=1"; $sql = $dbcon->execute($sql); $orders = $dbcon->getResultArray($sql); $streets = array_unique(array_filter(multi2single('ebay_street', $orders))); if (count($streets) == 1) { return 'KP'; } else { return ''; } }
public static function checkprintcard($shipOrderId) { self::initDB(); $sql = "select a.platformUsername,a.transportId,a.accountId,b.recordNumber from wh_shipping_order as a \n\t\t\t\t\tleft join wh_shipping_order_relation as b on a.id=b.shipOrderId \n\t\t\t\t\twhere a.id={$shipOrderId}"; $result = self::$dbConn->fetch_first($sql); $account = CommonModel::getAccountNameById($result['accountId']); $shipingname = CommonModel::getShipingNameById($result['transportId']); $ebayAccArr = CommonModel::getEbayAccountList(); if (!in_array($shipingname, array('中国邮政挂号', '中国邮政平邮', '香港小包挂号', '香港小包平邮', 'EUB'))) { return ''; } if (in_array($account, $ebayAccArr)) { return ''; } if (!in_array($account, $ebayAccArr) && preg_match("/[a-z]+/i", $result['recordnumber'])) { return ''; } if ($account == 'dresslink.com') { return ''; } $sql = "SELECT street FROM wh_shipping_order WHERE platformUsername='******'platformUsername']}' AND orderStatus!=900"; $query = self::$dbConn->query($sql); $orders = self::$dbConn->fetch_array_all($query); $streets = array_unique(array_filter(multi2single('street', $orders))); if (count($streets) == 1) { return 'KP'; } else { return ''; } }