OrderCategory.php 783 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\admin\model;
  3. use think\Model;
  4. use think\model\concern\SoftDelete;
  5. class OrderCategory extends Model{
  6. use SoftDelete;
  7. protected $createTime = 'createTime';
  8. protected $deleteTime='delete_time';
  9. public static function checkInfo($code,$orderType,$info){
  10. $isT=self::where(['code'=>$code,'orderType'=>$orderType])->findOrEmpty();
  11. if($isT->isEmpty()){
  12. $isT->code = $code;
  13. $isT->orderType = $orderType;
  14. $isT->cat_code=$info['cat_code'];
  15. $isT->cat_name=$info['cat_name'];
  16. $isT->tax=$info['tax'];
  17. $isT->inv_good_name = $info['inv_good_name'];
  18. $save=$isT->save();
  19. if(!$save)throw new \Exception('订单类目保存失败');
  20. }
  21. }
  22. }