本文整理汇总了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'));
}
}