GoodsDeliveryTemplateLogic.php 962 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\adminapi\logic\goods;
  3. use app\common\model\GoodsDeliveryTemplate;
  4. class GoodsDeliveryTemplateLogic
  5. {
  6. function add($data): bool
  7. {
  8. GoodsDeliveryTemplate::create([
  9. 'name' => $data['name'],
  10. 'type' => $data['type'],
  11. 'content' => $data['content'] ?? '',
  12. 'content1' => $data['content1'] ?? [],
  13. ]);
  14. return true;
  15. }
  16. function edit($data): bool
  17. {
  18. GoodsDeliveryTemplate::update([
  19. 'name' => $data['name'],
  20. 'type' => $data['type'],
  21. 'content' => $data['content'] ?? '',
  22. 'content1' => $data['content1'] ?? [],
  23. ],[ [ 'id', '=', $data['id'] ] ]);
  24. return true;
  25. }
  26. function delete($data)
  27. {
  28. GoodsDeliveryTemplate::destroy($data['id']);
  29. return true;
  30. }
  31. }