feat:depotPurchase

This commit is contained in:
LAPTOP-7SGDREK0\shiweijun
2025-02-05 16:11:00 +08:00
parent ec15f9b13d
commit 3f7d8f5cad
6 changed files with 94 additions and 18 deletions

View File

@@ -36,13 +36,16 @@ class MaterialStock extends Model
*/
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)
->where('is_del',MaterialCode::IS_NO_DEL)
->first();
}
}