Merge branch 'dev' into branch-dev
This commit is contained in:
@@ -13,7 +13,8 @@ use Hyperf\Tappable\HigherOrderTapProxy;
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property string $profile
|
||||
* @property string $specialties
|
||||
* @property string $specialties
|
||||
* @property int $kitchen_id
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
@@ -33,7 +34,7 @@ class Chef extends Model
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'user_id' => 'integer', 'is_del' => 'integer'];
|
||||
protected array $casts = ['id' => 'integer', 'user_id' => 'integer', 'kitchen_id' => 'integer', 'is_del' => 'integer'];
|
||||
|
||||
const string CREATED_AT = 'create_time';
|
||||
|
||||
|
||||
59
app/Model/Depot.php
Normal file
59
app/Model/Depot.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Admin\DepotCode;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property int $city_id
|
||||
* @property int $kitchen_id
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
*/
|
||||
class Depot extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'depot';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'city_id' => 'integer', 'kitchen_id' => 'integer', 'is_del' => 'integer'];
|
||||
|
||||
const CREATED_AT = 'create_time';
|
||||
|
||||
const UPDATED_AT = 'update_time';
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return \Hyperf\Database\Model\Model|Builder|null
|
||||
*/
|
||||
public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('id',$id)->where('is_del',DepotCode::IS_NO_DEL)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param int $kitchen_id
|
||||
* @return \Hyperf\Database\Model\Model|Builder|null
|
||||
*/
|
||||
public function getInfoByName(string $name,int $kitchen_id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('name', $name)->where('kitchen_id',$kitchen_id)->where('is_del',DepotCode::IS_NO_DEL)->first();
|
||||
}
|
||||
}
|
||||
52
app/Model/DepotPurchase.php
Normal file
52
app/Model/DepotPurchase.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $depot_id
|
||||
* @property int $material_id
|
||||
* @property int $supplier_id
|
||||
* @property int $type
|
||||
* @property string $purchase_price
|
||||
* @property string $number
|
||||
* @property string $sum_price
|
||||
* @property int $status
|
||||
* @property int $city_id
|
||||
* @property int $kitchen_id
|
||||
* @property int $operator_id
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
*/
|
||||
class DepotPurchase extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'depot_purchase';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'depot_id' => 'integer', 'material_id' => 'integer', 'supplier_id' => 'integer', 'type' => 'integer', 'status' => 'integer', 'city_id' => 'integer', 'kitchen_id' => 'integer', 'operator_id' => 'integer', 'is_del' => 'integer'];
|
||||
|
||||
const CREATED_AT = 'create_time';
|
||||
|
||||
const UPDATED_AT = 'update_time';
|
||||
|
||||
public function getDepotPurchase(int $id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('id',$id)->first();
|
||||
}
|
||||
}
|
||||
52
app/Model/DepotRecycle.php
Normal file
52
app/Model/DepotRecycle.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $depot_id
|
||||
* @property int $material_id
|
||||
* @property int $supplier_id
|
||||
* @property string $recycle_price
|
||||
* @property string $number
|
||||
* @property string $sum_price
|
||||
* @property int $sale_id
|
||||
* @property int $status
|
||||
* @property int $city_id
|
||||
* @property int $kitchen_id
|
||||
* @property int $operator_id
|
||||
* @property int $is_del
|
||||
* @property \Carbon\Carbon $create_time
|
||||
* @property \Carbon\Carbon $update_time
|
||||
*/
|
||||
class DepotRecycle extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'depot_recycle';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'depot_id' => 'integer', 'material_id' => 'integer', 'supplier_id' => 'integer', 'sale_id' => 'integer', 'status' => 'integer', 'city_id' => 'integer', 'kitchen_id' => 'integer', 'operator_id' => 'integer', 'is_del' => 'integer', 'create_time' => 'datetime', 'update_time' => 'datetime'];
|
||||
|
||||
const string CREATED_AT = 'create_time';
|
||||
|
||||
const string UPDATED_AT = 'update_time';
|
||||
|
||||
public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('id', $id)->first();
|
||||
}
|
||||
}
|
||||
53
app/Model/DepotSale.php
Normal file
53
app/Model/DepotSale.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $depot_id
|
||||
* @property int $material_id
|
||||
* @property int $supplier_id
|
||||
* @property int $dish_id
|
||||
* @property string $sale_price
|
||||
* @property string $number
|
||||
* @property string $back_number
|
||||
* @property string $sum_price
|
||||
* @property int $application_id
|
||||
* @property int $city_id
|
||||
* @property int $kitchen_id
|
||||
* @property int $operator_id
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
*/
|
||||
class DepotSale extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'depot_sale';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'depot_id' => 'integer', 'material_id' => 'integer', 'supplier_id' => 'integer', 'dish_id' => 'integer', 'application_id' => 'integer', 'city_id' => 'integer', 'kitchen_id' => 'integer', 'operator_id' => 'integer', 'is_del' => 'integer'];
|
||||
|
||||
const string CREATED_AT = 'create_time';
|
||||
|
||||
const string UPDATED_AT = 'update_time';
|
||||
|
||||
public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('id', $id)->first();
|
||||
}
|
||||
}
|
||||
56
app/Model/Dish.php
Normal file
56
app/Model/Dish.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Common\DishCode;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $dish
|
||||
* @property string $profile
|
||||
* @property int $pre_quantity
|
||||
* @property string $price
|
||||
* @property string $side_dish
|
||||
* @property string $flavor
|
||||
* @property string $date
|
||||
* @property int $city_id
|
||||
* @property int $kitchen_id
|
||||
* @property int $chef_id
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
*/
|
||||
class Dish extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'dish';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'pre_quantity' => 'integer', 'city_id' => 'integer','kitchen_id' => 'integer', 'chef_id' => 'integer', 'is_del' => 'integer'];
|
||||
|
||||
const string CREATED_AT = 'create_time';
|
||||
|
||||
const string UPDATED_AT = 'update_time';
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return \Hyperf\Database\Model\Model|Builder|null
|
||||
*/
|
||||
public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('id',$id)->where('is_del',DishCode::IS_NO_DEL)->first();
|
||||
}
|
||||
}
|
||||
54
app/Model/Material.php
Normal file
54
app/Model/Material.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Common\MaterialCode;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $category_id
|
||||
* @property string $name
|
||||
* @property string $standard
|
||||
* @property string $unit
|
||||
* @property string $bar_code
|
||||
* @property int $status
|
||||
* @property int $city_id
|
||||
* @property int $kitchen_id
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
*/
|
||||
class Material extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'material';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'category_id' => 'integer', 'status' => 'integer', 'city_id' => 'integer', 'kitchen_id' => 'integer', 'is_del' => 'integer'];
|
||||
|
||||
const CREATED_AT = 'create_time';
|
||||
|
||||
const UPDATED_AT = 'update_time';
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return \Hyperf\Database\Model\Model|Builder|null
|
||||
*/
|
||||
public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('is_del',MaterialCode::IS_NO_DEL)->where('id',$id)->first();
|
||||
}
|
||||
}
|
||||
50
app/Model/MaterialApplication.php
Normal file
50
app/Model/MaterialApplication.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $material_id
|
||||
* @property int $dish_id
|
||||
* @property string $number
|
||||
* @property string $al_number
|
||||
* @property string $processing
|
||||
* @property int $status
|
||||
* @property int $city_id
|
||||
* @property int $kitchen_id
|
||||
* @property int $operator_id
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
*/
|
||||
class MaterialApplication extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'material_application';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'material_id' => 'integer', 'dish_id' => 'integer', 'status' => 'integer', 'city_id' => 'integer', 'kitchen_id' => 'integer', 'operator_id' => 'integer', 'is_del' => 'integer'];
|
||||
|
||||
const CREATED_AT = 'create_time';
|
||||
|
||||
const UPDATED_AT = 'update_time';
|
||||
|
||||
public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('id', $id)->first();
|
||||
}
|
||||
}
|
||||
59
app/Model/MaterialCategory.php
Normal file
59
app/Model/MaterialCategory.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Common\MaterialCode;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property int $parent_id
|
||||
* @property int $city_id
|
||||
* @property int $kitchen_id
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
*/
|
||||
class MaterialCategory extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'material_category';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'parent_id' => 'integer', 'city_id' => 'integer', 'kitchen_id' => 'integer', 'is_del' => 'integer'];
|
||||
|
||||
const CREATED_AT = 'create_time';
|
||||
|
||||
const UPDATED_AT = 'update_time';
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return \Hyperf\Database\Model\Model|Builder|null
|
||||
*/
|
||||
public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('is_del',MaterialCode::IS_NO_DEL)->where('id',$id)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return \Hyperf\Database\Model\Model|Builder|null
|
||||
*/
|
||||
public function getInfoByPId(int $id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('is_del',MaterialCode::IS_NO_DEL)->where('parent_id',$id)->first();
|
||||
}
|
||||
}
|
||||
51
app/Model/MaterialStock.php
Normal file
51
app/Model/MaterialStock.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Common\MaterialCode;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $material_id
|
||||
* @property int $depot_id
|
||||
* @property int $supplier_id
|
||||
* @property string $current_stock
|
||||
* @property string $unit_price
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
*/
|
||||
class MaterialStock extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'material_stock';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'material_id' => 'integer', 'depot_id' => 'integer', 'supplier_id' => 'integer', 'is_del' => 'integer'];
|
||||
|
||||
const CREATED_AT = 'create_time';
|
||||
|
||||
const UPDATED_AT = 'update_time';
|
||||
|
||||
public function getMaterial(int $material_id,int $depot_id,int $supplier_id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('is_del',MaterialCode::IS_NO_DEL)
|
||||
->where('material_id',$material_id)
|
||||
->where('depot_id',$depot_id)
|
||||
->where('supplier_id',$supplier_id)
|
||||
->first();
|
||||
}
|
||||
}
|
||||
50
app/Model/Supplier.php
Normal file
50
app/Model/Supplier.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $mobile
|
||||
* @property string $address
|
||||
* @property int $city_id
|
||||
* @property int $kitchen_id
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
*/
|
||||
class Supplier extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'supplier';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'city_id' => 'integer', 'kitchen_id' => 'integer', 'is_del' => 'integer'];
|
||||
|
||||
const CREATED_AT = 'create_time';
|
||||
|
||||
const UPDATED_AT = 'update_time';
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return \Hyperf\Database\Model\Model|Builder|null
|
||||
*/
|
||||
public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('id',$id)->where('is_del',1)->first();
|
||||
}
|
||||
}
|
||||
48
app/Model/WarehouseKeeper.php
Normal file
48
app/Model/WarehouseKeeper.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Admin\UserCode;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int $kitchen_id
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
*/
|
||||
class WarehouseKeeper extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'warehouse_keeper';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'user_id' => 'integer', 'kitchen_id' => 'integer', 'is_del' => 'integer'];
|
||||
|
||||
const string CREATED_AT = 'create_time';
|
||||
|
||||
const string UPDATED_AT = 'update_time';
|
||||
|
||||
/**
|
||||
* @param int $userId
|
||||
* @return Builder|\Hyperf\Database\Model\Model|null
|
||||
*/
|
||||
public function getInfoByUserId(int $userId): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('is_del',UserCode::IS_NO_DEL)->where('user_id', $userId)->first();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user