v.1.8 update
This commit is contained in:
@@ -58,24 +58,23 @@ class ClientFile extends HRCCommand implements HRCCommandInterface {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$clientsCount = Client::count();
|
$clientsCount = Client::count();
|
||||||
$urlThread = $input['th'];
|
$urlThread = $input['th'];
|
||||||
$mainThreads = 4;
|
$mainThreads = 4;
|
||||||
$countPerThread = ceil($clientsCount / $mainThreads);
|
$countPerThread = ceil($clientsCount / $mainThreads);
|
||||||
$offset = ($urlThread - 1) * $countPerThread;
|
$offset = ($urlThread - 1) * $countPerThread;
|
||||||
$clients = Client::with('clientPhone:client_guid')->skip($offset)->take($countPerThread)->get();
|
$clients = Client::with('clientPhone:client_guid')->skip($offset)->take($countPerThread)->get();
|
||||||
|
|
||||||
if (!is_dir($tmp_dirname)) {
|
if (!is_dir($tmp_dirname)) {
|
||||||
mkdir($tmp_dirname, 0755, 'w+');
|
mkdir($tmp_dirname, 0755, 'w+');
|
||||||
}
|
}
|
||||||
$filename = str_replace(' ', '_', date("d.m.Y H.i.s")) . '_' . $urlThread . '.tmp';
|
$filename = str_replace(' ', '_', date("d.m.Y H.i.s")) . '_' . $urlThread . '.tmp';
|
||||||
$handle = fopen($tmp_dirname . $filename, 'w+');
|
$handle = fopen($tmp_dirname . $filename, 'w+');
|
||||||
$filename = str_replace('_', ' ', $filename);
|
$filename = str_replace('_', ' ', $filename);
|
||||||
foreach ($clients as $row) {
|
foreach ($clients as $row) {
|
||||||
if (($row['clientPhone']->phone !== '') && ($row['clientPhone']->phone !== '+375 ( ) - -')) {
|
if (($row['clientPhone']->phone !== '') && ($row['clientPhone']->phone !== '+375 ( ) - -')) {
|
||||||
$row = array($row['name'], $row['clientPhone']->phone);
|
$row = array($row['name'], $row['clientPhone']->phone);
|
||||||
fputcsv($handle, $row, ';');
|
fputcsv($handle, $row, ';');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ class GETOrder extends HRCCommand implements HRCCommandInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$orderItems = OrderItems::where('order_id', '=', $order->id)->whereNull('modifier_id')->get();
|
$orderItems = OrderItems::where('order_id', '=', $order->id)->whereNull('modifier_id')->get();
|
||||||
$modOut = array();
|
|
||||||
if (isset($orderItems)) {
|
if (isset($orderItems)) {
|
||||||
foreach ($orderItems as $key => $item) {
|
foreach ($orderItems as $key => $item) {
|
||||||
$itemName = Dishes::where('code', '=', $item->item_id)->first();
|
$itemName = Dishes::where('code', '=', $item->item_id)->first();
|
||||||
@@ -42,9 +41,9 @@ class GETOrder extends HRCCommand implements HRCCommandInterface {
|
|||||||
$itemModifiers = OrderItems::where('order_id', '=', $order->id)->where('parent_id', '=', $item->id)->whereNotNull('modifier_id')->get();
|
$itemModifiers = OrderItems::where('order_id', '=', $order->id)->where('parent_id', '=', $item->id)->whereNotNull('modifier_id')->get();
|
||||||
if (isset($itemModifiers)) {
|
if (isset($itemModifiers)) {
|
||||||
foreach ($itemModifiers as $key => $itemModifier) {
|
foreach ($itemModifiers as $key => $itemModifier) {
|
||||||
$modifier = Modifier::where('id', '=', $itemModifier->modifier_id)->first();
|
$modifier = Modifier::where('code', '=', $itemModifier->modifier_id)->first();
|
||||||
if ($modifier->dish_code == 0 && $modifier->unit_id == 0) {
|
if ($modifier->dish_code == 0 && $modifier->unit_id == 0) {
|
||||||
$modOut[] = array('' => , );
|
$modOut[] = array('id' => $modifier->code, 'name' => $modifier->name, 'price' => '*');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user