ComonOrder.php 832 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\admin\model;
  4. use think\Model;
  5. /**
  6. * @mixin \think\Model
  7. */
  8. class ComonOrder extends Model
  9. {
  10. protected $createTime='addtime';
  11. protected $updateTime='updatetime';
  12. public static function is_common($code){
  13. $isT= self::where("orderCode|cgdNo",$code)->findOrEmpty();
  14. return $isT->isEmpty()? 0:1;
  15. }
  16. public function Qrd(){
  17. return $this->belongsTo(QrdInfo::class,"orderCode","sequenceNo");
  18. }
  19. public function Cgd(){
  20. return $this->belongsTo(CgdInfo::class,'cgdNo','sequenceNo');
  21. }
  22. public function Good(){
  23. return $this->belongsTo(Good::class,'goodNo','spuCode');
  24. }
  25. // 检测是否已经取消
  26. public static function CheckCxCode($code){
  27. self::where(["cxCode"=>$code,"status"=>0])->update(["status"=>-1]);
  28. }
  29. }