init
This commit is contained in:
11
app/model/Access.php
Normal file
11
app/model/Access.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
use think\model\Pivot;
|
||||
|
||||
class Access extends Pivot
|
||||
{
|
||||
|
||||
}
|
||||
45
app/model/Admin.php
Normal file
45
app/model/Admin.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use app\model\Admin as AdminModel;
|
||||
use think\Model;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class Admin extends Model
|
||||
{
|
||||
//添加后缀需要设置模型名称
|
||||
protected $name = 'admin';
|
||||
|
||||
//设置主键
|
||||
protected $pk = 'id';
|
||||
|
||||
use SoftDelete;
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
// public function role(){
|
||||
// return $this->belongsToMany(Role::class,Access::class,'role_id','admin_id');
|
||||
// }
|
||||
|
||||
public function searchUsernameAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('username', 'like', '%'.$value.'%') : '';
|
||||
}
|
||||
|
||||
public function searchNicknameAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('Nickname', 'like', '%'.$value.'%') : '';
|
||||
}
|
||||
|
||||
public function searchEmailAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('email', 'like', '%'.$value.'%') : '';
|
||||
}
|
||||
|
||||
public function searchPhoneAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('phone', 'like', '%'.$value.'%') : '';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
41
app/model/ChargeOrder.php
Normal file
41
app/model/ChargeOrder.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class ChargeOrder extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
public function searchOrderNumberAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('order_number', 'like', '%'.$value.'%') : '';
|
||||
}
|
||||
|
||||
public function searchChargeStationIdAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('charge_station_id', '=', $value) : '';
|
||||
}
|
||||
|
||||
public function searchOpenidAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('openid', 'like', '%'.$value.'%') : '';
|
||||
}
|
||||
|
||||
public function searchChargeDateAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->whereTime('charge_date', '>=', $value) : '';
|
||||
}
|
||||
|
||||
public function searchStatusAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('status', '=', "'".$value."'") : '';
|
||||
}
|
||||
}
|
||||
48
app/model/ChargeStation.php
Normal file
48
app/model/ChargeStation.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class ChargeStation extends Model
|
||||
{
|
||||
public function searchChargeStationNameAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('charge_station_name', 'like', '%'.$value.'%') : '';
|
||||
}
|
||||
|
||||
public function searchStationTypeAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('station_type', '=', $value) : '';
|
||||
}
|
||||
|
||||
public function searchCityAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('city', 'like', '%'.$value.'%') : '';
|
||||
}
|
||||
|
||||
public function searchAreaAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('area', 'like', '%'.$value.'%') : '';
|
||||
}
|
||||
|
||||
public function searchStreetAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('street', 'like', '%'.$value.'%') : '';
|
||||
}
|
||||
|
||||
public function searchAddressAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('address', 'like', '%'.$value.'%') : '';
|
||||
}
|
||||
|
||||
public function searchPriceAttr($query, $value)
|
||||
{
|
||||
return $value ? $query->where('price', 'between', [intval($value),intval($value)+1]) : '';
|
||||
}
|
||||
|
||||
}
|
||||
12
app/model/Enterprise.php
Normal file
12
app/model/Enterprise.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class Enterprise extends Model
|
||||
{
|
||||
protected $createTime = 'create_time';
|
||||
protected $updateTime = 'update_time';
|
||||
}
|
||||
12
app/model/EnterpriseCar.php
Normal file
12
app/model/EnterpriseCar.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class EnterpriseCar extends Model
|
||||
{
|
||||
protected $createTime = 'create_time';
|
||||
|
||||
protected $updateTime = 'update_time';
|
||||
}
|
||||
10
app/model/EnterpriseGroup.php
Normal file
10
app/model/EnterpriseGroup.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class EnterpriseGroup extends Model
|
||||
{
|
||||
protected $createTime = 'create_time';
|
||||
}
|
||||
10
app/model/EnterpriseUser.php
Normal file
10
app/model/EnterpriseUser.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class EnterpriseUser extends Model
|
||||
{
|
||||
protected $createTime = 'create_time';
|
||||
}
|
||||
14
app/model/Event.php
Normal file
14
app/model/Event.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class Event extends Model
|
||||
{
|
||||
protected $createTime = 'create_time';
|
||||
protected $updateTime = 'last_update_time';
|
||||
use SoftDelete;
|
||||
protected $deleteTime = 'delete_time';
|
||||
}
|
||||
10
app/model/Role.php
Normal file
10
app/model/Role.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Role extends Model
|
||||
{
|
||||
|
||||
}
|
||||
10
app/model/ServiceFee.php
Normal file
10
app/model/ServiceFee.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ServiceFee extends Model
|
||||
{
|
||||
|
||||
}
|
||||
17
app/model/SystemRequestLog.php
Normal file
17
app/model/SystemRequestLog.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class SystemRequestLog extends Model
|
||||
{
|
||||
protected $table = 'system_request_logs';
|
||||
|
||||
protected $autoWriteTimestamp = 'datetime';
|
||||
protected $createTime = 'create_time';
|
||||
protected $updateTime = false;
|
||||
|
||||
protected $type = [
|
||||
'params' => 'json',
|
||||
];
|
||||
}
|
||||
27
app/model/User.php
Normal file
27
app/model/User.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\facade\Db;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class User extends Model
|
||||
{
|
||||
|
||||
//用户金额记录日志
|
||||
public static function addMoneyLog($openid, $money, $type, $mark)
|
||||
{
|
||||
Db::table('zxc_user_money_log')->insert([
|
||||
'openid' => $openid,
|
||||
'money' => $money,
|
||||
'type' => $type,
|
||||
'mark' => $mark,
|
||||
'createtime' => date('Y-m-d H:i:s', time()),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
10
app/model/Vinlicense.php
Normal file
10
app/model/Vinlicense.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Vinlicense extends Model
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user