OrderItemController.php 835 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace console\controllers;
  3. use bizGhs\order\classes\OrderItemClass;
  4. use yii\console\Controller;
  5. /**
  6. * 订单相关
  7. */
  8. class OrderItemController extends Controller
  9. {
  10. public function actionCost()
  11. {
  12. ini_set('memory_limit', '2045M');
  13. set_time_limit(0);
  14. $list = OrderItemClass::getAllByCondition(['id<' => 333152, 'xhUnitType' => 1], 'id DESC', '*', null, true);
  15. if (!empty($list)) {
  16. foreach ($list as $key => $item) {
  17. $cost = $item->cost ?? 0;
  18. $ratio = $item->ratio ?? 21;
  19. $productId = $item->productId ?? 0;
  20. $name = $item->name ?? '';
  21. if ($cost < 10) {
  22. echo $productId . ' ' . $name . ' ' . $cost . ' ' . $ratio . "\n";
  23. }
  24. }
  25. }
  26. }
  27. }