2 Commits
1.0.4 ... 1.0.6

Author SHA1 Message Date
711940ecce 改名 2021-06-16 15:05:26 +08:00
563db90d6b 微调 2021-06-15 13:49:25 +08:00
5 changed files with 83 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "xuanchen/washcar", "name": "xuanchen/washcar",
"description": "平安sdk", "description": "洗车券",
"license": "MIT", "license": "MIT",
"homepage": "http://git.yuzhankeji.cn/xuanchen/PingAnWashCar.git", "homepage": "http://git.yuzhankeji.cn/xuanchen/PingAnWashCar.git",
"authors": [ "authors": [

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWashcarCouponsTable extends Migration
{
/**
* Run the migrations.
* @return void
*/
public function up()
{
Schema::create('washcar_coupons', function (Blueprint $table) {
$table->bigIncrements('id');
$table->morphs('order');
$table->string('code');
$table->boolean('status')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
* @return void
*/
public function down()
{
Schema::dropIfExists('washcar_coupons');
}
}

21
src/Models/Model.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
namespace XuanChen\WashCar\Models;
use Carbon\Carbon;
class Model extends \Illuminate\Database\Eloquent\Model
{
protected $guarded = [];
protected function serializeDate(\DateTimeInterface $date)
{
if (version_compare(app()->version(), '7.0.0') < 0) {
return parent::serializeDate($date);
}
return $date->format(Carbon::DEFAULT_TO_STRING_FORMAT);
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace XuanChen\WashCar\Models;
use Carbon\Carbon;
class WashcarCoupon extends Model
{
protected $casts = [
'in_source' => 'json',
'out_source' => 'json',
];
const STATUS_INIT = 1;
const STATUS_SUCCESS = 2;
const STATUS_ERROR = 3;
const STATUS = [
self::STATUS_INIT => '初始',
self::STATUS_SUCCESS => '成功',
self::STATUS_ERROR => '失败',
];
}

View File

@@ -4,12 +4,10 @@ namespace XuanChen\WashCar\Models;
use Carbon\Carbon; use Carbon\Carbon;
class WashcarLog extends \Illuminate\Database\Eloquent\Model class WashcarLog extends Model
{ {
protected $guarded = []; protected $casts = [
protected $casts = [
'in_source' => 'json', 'in_source' => 'json',
'out_source' => 'json', 'out_source' => 'json',
]; ];
@@ -24,13 +22,4 @@ class WashcarLog extends \Illuminate\Database\Eloquent\Model
self::STATUS_ERROR => '失败', self::STATUS_ERROR => '失败',
]; ];
protected function serializeDate(\DateTimeInterface $date)
{
if (version_compare(app()->version(), '7.0.0') < 0) {
return parent::serializeDate($date);
}
return $date->format(Carbon::DEFAULT_TO_STRING_FORMAT);
}
} }