初始化项目
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\store\model;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\Notify as NotifyModel;
|
||||
|
||||
/**
|
||||
* 通知管理
|
||||
* Class Order
|
||||
* @package app\store\model
|
||||
*/
|
||||
class Notify extends NotifyModel
|
||||
{
|
||||
/**
|
||||
* 通知列表
|
||||
* @return \think\Paginator
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function getList()
|
||||
{
|
||||
// 获取数据列表
|
||||
return $this->where('status', '=', 0)
|
||||
->order(['create_time' => 'asc'])
|
||||
->paginate(200);
|
||||
}
|
||||
/**
|
||||
* 新增通知记录
|
||||
* @param $order
|
||||
* @return false|int
|
||||
*/
|
||||
public function add($order)
|
||||
{
|
||||
return $this->save([
|
||||
'order_id' => $order['order_id'],
|
||||
'notify_url' => $order['notify_url'],
|
||||
'store_id' => 10001,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改通知状态
|
||||
* @param $data
|
||||
* @return bool
|
||||
*/
|
||||
public function sureNotify($data)
|
||||
{
|
||||
return $this->save([
|
||||
'status' => $data['status'],
|
||||
'last_time' => time(),
|
||||
]) !== false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user