1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- declare (strict_types = 1);
- namespace app\admin\model;
- use think\Model;
- /**
- * @mixin \think\Model
- */
- class ComonOrder extends Model
- {
- protected $createTime='addtime';
- protected $updateTime='updatetime';
-
- public static function is_common($code){
- $isT= self::where("orderCode|cgdNo",$code)->findOrEmpty();
- return $isT->isEmpty()? 0:1;
- }
-
- public function Qrd(){
- return $this->belongsTo(QrdInfo::class,"orderCode","sequenceNo");
- }
-
- public function Cgd(){
- return $this->belongsTo(CgdInfo::class,'cgdNo','sequenceNo');
- }
- public function Good(){
- return $this->belongsTo(Good::class,'goodNo','spuCode');
- }
- // 检测是否已经取消
- public static function CheckCxCode($code){
- self::where(["cxCode"=>$code,"status"=>0])->update(["status"=>-1]);
- }
- }
|