feat: 新增采购订单列表及详情模型与控制器
This commit is contained in:
parent
d9bb85651e
commit
ddaef44baf
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\admin\controller\purchase_order;
|
||||||
|
use app\admin\controller\BaseAdminController;
|
||||||
|
use app\admin\lists\purchase_order\PurchaseOrderLists;
|
||||||
|
|
||||||
|
class PurchaseOrderController extends BaseAdminController{
|
||||||
|
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new PurchaseOrderLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
62
app/admin/lists/purchase_order/PurchaseOrderLists.php
Normal file
62
app/admin/lists/purchase_order/PurchaseOrderLists.php
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\lists\purchase_order;
|
||||||
|
|
||||||
|
|
||||||
|
use app\admin\lists\BaseAdminDataLists;
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use app\common\model\purchase_order\PurchaseOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购订单列表
|
||||||
|
* Class PurchaseOrderLists
|
||||||
|
* @package app\admin\lists\purchase_order
|
||||||
|
*/
|
||||||
|
class PurchaseOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author admin
|
||||||
|
* @date 2024/05/31 17:09
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'=' => ['store_id', 'order_id'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取采购订单列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author admin
|
||||||
|
* @date 2024/05/31 17:09
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
return PurchaseOrder::where($this->searchWhere)
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['id' => 'desc'])
|
||||||
|
->select();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取采购订单数量
|
||||||
|
* @return int
|
||||||
|
* @author admin
|
||||||
|
* @date 2024/05/31 17:09
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
return PurchaseOrder::where($this->searchWhere)->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
22
app/common/model/purchase_order/PurchaseOrder.php
Normal file
22
app/common/model/purchase_order/PurchaseOrder.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\model\purchase_order;
|
||||||
|
|
||||||
|
|
||||||
|
use app\common\model\BaseModel;
|
||||||
|
use think\model\concern\SoftDelete;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购订单
|
||||||
|
* Class PurchaseOrder
|
||||||
|
* @package app\common\model\purchase_order
|
||||||
|
*/
|
||||||
|
class PurchaseOrder extends BaseModel
|
||||||
|
{
|
||||||
|
use SoftDelete;
|
||||||
|
protected $name = 'purchase_order';
|
||||||
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
|
|
||||||
|
}
|
22
app/common/model/purchase_order_info/PurchaseOrderInfo.php
Normal file
22
app/common/model/purchase_order_info/PurchaseOrderInfo.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\model\purchase_order_info;
|
||||||
|
|
||||||
|
|
||||||
|
use app\common\model\BaseModel;
|
||||||
|
use think\model\concern\SoftDelete;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购订单详情
|
||||||
|
* Class PurchaseOrderInfo
|
||||||
|
* @package app\common\model\purchase_order_info
|
||||||
|
*/
|
||||||
|
class PurchaseOrderInfo extends BaseModel
|
||||||
|
{
|
||||||
|
use SoftDelete;
|
||||||
|
protected $name = 'purchase_order_info';
|
||||||
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user