酒店预订平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

PurchasePriceDao.php 1.3 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: nizongfeng
  5. * Date: 2021/10/27
  6. * Time: 19:19
  7. */
  8. namespace app\admin\service;
  9. use app\admin\command\Util;
  10. use app\admin\model\PurchasePrice;
  11. use think\Exception;
  12. class PurchasePriceDao
  13. {
  14. /**
  15. * 添加采购单每日价格
  16. * @param $param
  17. * @param int $order_id
  18. * @param string $prod_type
  19. * @param int $order_detail_id
  20. * @param int $purchase_id
  21. * @return array
  22. */
  23. public function addList($param,int $order_id,string $prod_type,int $order_detail_id,int $purchase_id){
  24. try {
  25. foreach ($param as $value) {
  26. $data = [
  27. "order_id" => $order_id,
  28. "prod_type" => $prod_type,
  29. "order_detail_id" => $order_detail_id,
  30. "purchase_id" => $purchase_id,
  31. "run_date" => $value['run_date'],
  32. "count" => $value['count'],
  33. "price" => $value['price'],
  34. "cost" => $value['cost']
  35. ];
  36. $model = new PurchasePrice();
  37. $model->insertGetId($data);
  38. }
  39. return Util::returnArrSu();
  40. }catch (Exception $e){
  41. return Util::returnArrEr("添加采购单每日价格失败".$e->getMessage());
  42. }
  43. }
  44. }