partial #1860
This commit is contained in:
parent
e90f7102fe
commit
c847f422c5
@ -1157,6 +1157,7 @@ class Crunchbutton_Order extends Cana_Table {
|
||||
}
|
||||
|
||||
public function exports() {
|
||||
|
||||
$out = $this->properties();
|
||||
|
||||
unset($out['id_user']);
|
||||
@ -1164,21 +1165,30 @@ class Crunchbutton_Order extends Cana_Table {
|
||||
unset($out['id_order']);
|
||||
|
||||
$out['id'] = $this->uuid;
|
||||
|
||||
$out['_restaurant_name'] = $this->restaurant()->name;
|
||||
$out['_restaurant_permalink'] = $this->restaurant()->permalink;
|
||||
$out['_restaurant_phone'] = $this->restaurant()->phone;
|
||||
$out['user'] = $this->user()->uuid;
|
||||
$out['_message'] = nl2br($this->orderMessage('web'));
|
||||
$out['charged'] = $this->charged();
|
||||
$credit = $this->chargedByCredit();
|
||||
if( $credit > 0 ){
|
||||
$out['credit'] = $credit;
|
||||
} else {
|
||||
$out['credit'] = 0;
|
||||
}
|
||||
|
||||
$timezone = new DateTimeZone($this->restaurant()->timezone);
|
||||
if( isset( $out[ 'type' ] ) && $out[ 'type' ] == 'compressed' ){
|
||||
$out['_restaurant_name'] = $out['restaurant_name'];
|
||||
$out['_restaurant_permalink'] = $out['restaurant_permalink'];
|
||||
$timezone = new DateTimeZone( $out['timezone'] );
|
||||
unset( $out['type'] );
|
||||
unset( $out['uuid'] );
|
||||
unset( $out['restaurant_name'] );
|
||||
unset( $out['restaurant_permalink'] );
|
||||
} else {
|
||||
$out['_restaurant_name'] = $this->restaurant()->name;
|
||||
$out['_restaurant_permalink'] = $this->restaurant()->permalink;
|
||||
$out['_restaurant_phone'] = $this->restaurant()->phone;
|
||||
$out['user'] = $this->user()->uuid;
|
||||
$out['_message'] = nl2br($this->orderMessage('web'));
|
||||
$out['charged'] = $this->charged();
|
||||
$credit = $this->chargedByCredit();
|
||||
if( $credit > 0 ){
|
||||
$out['credit'] = $credit;
|
||||
} else {
|
||||
$out['credit'] = 0;
|
||||
}
|
||||
$timezone = new DateTimeZone($this->restaurant()->timezone);
|
||||
}
|
||||
|
||||
$date = new DateTime($this->date);
|
||||
$date->setTimeZone($timezone);
|
||||
|
||||
@ -14,7 +14,8 @@ class Crunchbutton_User extends Cana_Table {
|
||||
|
||||
public function orders() {
|
||||
$orders = Order::q('
|
||||
select * from `order`
|
||||
select o.date, o.id_order, o.uuid, r.name restaurant_name, r.permalink restaurant_permalink, r.timezone timezone, "compressed" type from `order` o
|
||||
inner join restaurant r on r.id_restaurant = o.id_restaurant
|
||||
where
|
||||
id_user="'.$this->id_user.'"
|
||||
and id_user is not null
|
||||
|
||||
@ -2,9 +2,13 @@
|
||||
<div class="main-content-readable home-greeting">
|
||||
<div class="home-welcome">
|
||||
<h1>Finding your awesome orders...</h1>
|
||||
<div>
|
||||
<img src="/assets/images/orders-loading.gif" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="orders.list" class="main-content-readable">
|
||||
|
||||
<div class="restaurant-item-title">PAST ORDERS</div>
|
||||
|
||||
BIN
www/assets/images/orders-loading.gif
Normal file
BIN
www/assets/images/orders-loading.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Loading…
x
Reference in New Issue
Block a user