本文整理匯總了PHP中Products::getAllServicesByCustomerID方法的典型用法代碼示例。如果您正苦於以下問題:PHP Products::getAllServicesByCustomerID方法的具體用法?PHP Products::getAllServicesByCustomerID怎麽用?PHP Products::getAllServicesByCustomerID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Products
的用法示例。
在下文中一共展示了Products::getAllServicesByCustomerID方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAll
public function getAll($uuid)
{
$customers = Customers::findWithUuid($uuid);
if (empty($customers)) {
throw new Shineisp_Api_Exceptions(400006, ":: 'uuid' not valid");
exit;
}
$id = $customers['customer_id'];
$services = Products::getAllServicesByCustomerID($id, 'o.order_id, oi.detail_id as detail_id, pd.name as productname,
DATE_FORMAT(oi.date_start, "%d/%m/%Y") AS date_start, DATE_FORMAT(oi.date_end, "%d/%m/%Y") AS date_end,
DATEDIFF(oi.date_end, CURRENT_DATE) AS daysleft, oi.price as price, oi.autorenew as autorenew, oi.uuid as uuid, s.status as status');
return $services;
}
示例2: servicesGrid
private function servicesGrid()
{
$request = Zend_Controller_Front::getInstance()->getRequest();
try {
if (isset($request->id) && is_numeric($request->id)) {
// In order to select only the fields interested we have to add an alias to all the fields. If the aliases are not created Doctrine will require an index field for each join created.
//$rs = Products::getAllServicesByCustomerID ( $request->id, 'oi.detail_id as detail_id, pd.name as productname' );
$rs = Products::getAllServicesByCustomerID($request->id, 'o.order_id, oi.detail_id as detail_id, pd.name as productname, DATE_FORMAT(oi.date_start, "%d/%m/%Y") AS date_start, DATE_FORMAT(oi.date_end, "%d/%m/%Y") AS date_end, DATEDIFF(oi.date_end, CURRENT_DATE) AS daysleft, oi.price as price, oi.autorenew as autorenew, oi.status_id as status');
if ($rs) {
$arrStatuses = Statuses::getList('orders');
foreach ($rs as $k => $v) {
if (isset($v['price'])) {
//* TODO: Format price based on locale
$rs[$k]['price'] = $v['price'];
}
if (isset($v['status']) && isset($arrStatuses[$v['status']])) {
$rs[$k]['status'] = $arrStatuses[$v['status']];
}
if (isset($v['autorenew'])) {
$rs[$k]['autorenew'] = $v['autorenew'] == 1 ? $this->translator->translate('Yes') : $this->translator->translate('Yes');
}
if (isset($v['date_start'])) {
$rs[$k]['date_start'] = Shineisp_Commons_Utilities::formatDateIn($v['date_start']);
}
if (isset($v['date_end'])) {
$rs[$k]['date_end'] = Shineisp_Commons_Utilities::formatDateIn($v['date_end']);
}
}
$columns[] = $this->translator->translate('Product');
$columns[] = $this->translator->translate('Creation Date');
$columns[] = $this->translator->translate('Expiry Date');
$columns[] = $this->translator->translate('Days left');
$columns[] = $this->translator->translate('Price');
$columns[] = $this->translator->translate('Automatic renewal');
$columns[] = $this->translator->translate('Status');
return array('name' => 'services', 'columns' => $columns, 'records' => $rs, 'edit' => array('controller' => 'ordersitems', 'action' => 'edit'), 'pager' => true);
}
}
} catch (Exception $e) {
$this->_helper->redirector('edit', 'customers', 'admin', array('id' => $request->id, 'mex' => $this->translator->translate('Unable to process the request at this time.') . ": " . $e->getMessage(), 'status' => 'danger'));
}
}