|
@@ -0,0 +1,43 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace app\common\model;
|
|
|
+
|
|
|
+use app\admin\model\Admin;
|
|
|
+use think\Model;
|
|
|
+use Yansongda\Supports\Str;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 配置模型
|
|
|
+ */
|
|
|
+class MobileOrder extends Model
|
|
|
+{
|
|
|
+
|
|
|
+
|
|
|
+ public static $status=[
|
|
|
+ 0=>'待付款',
|
|
|
+ 10=>'待发货',
|
|
|
+ 20=>'待收货',
|
|
|
+ 30=>'退款待处理',
|
|
|
+ 40=>'已退款',
|
|
|
+ ];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // 自动写入时间戳字段
|
|
|
+ protected $autoWriteTimestamp = true;
|
|
|
+
|
|
|
+ public function mobile(){
|
|
|
+ return $this->belongsTo(Mobile::class);
|
|
|
+ }
|
|
|
+ public function admin(){
|
|
|
+ return $this->belongsTo(Admin::class);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ protected static function init()
|
|
|
+ {
|
|
|
+ self::beforeInsert(function (self $mobileOrder){
|
|
|
+ $mobileOrder['order_no']=order_no();
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|