123456789101112131415161718192021222324252627 |
- <?php
- namespace app\admin\model;
- use think\Model;
- use think\model\concern\SoftDelete;
- class OrderCategory extends Model{
- use SoftDelete;
- protected $createTime = 'createTime';
- protected $deleteTime='delete_time';
- public static function checkInfo($code,$orderType,$info){
- $isT=self::where(['code'=>$code,'orderType'=>$orderType])->findOrEmpty();
- if($isT->isEmpty()){
- $isT->code = $code;
- $isT->orderType = $orderType;
- $isT->cat_code=$info['cat_code'];
- $isT->cat_name=$info['cat_name'];
- $isT->tax=$info['tax'];
- $isT->inv_good_name = $info['inv_good_name'];
- $save=$isT->save();
- if(!$save)throw new \Exception('订单类目保存失败');
- }
- }
- }
|