添加预订单日志
This commit is contained in:
parent
349b6c3f5f
commit
db0e7c6068
@ -292,4 +292,35 @@ class BeforehandOrderController extends BaseAdminController
|
||||
$file_path = BeforehandOrderLogic::ReturnSupplier($params);
|
||||
return $this->success('导出成功', ['url' => $file_path]);
|
||||
}
|
||||
|
||||
public function settle()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
BeforehandOrderLogic::settleOrder($params);
|
||||
return $this->success('确认成功');
|
||||
}
|
||||
|
||||
public function logList()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$result = BeforehandOrderLogic::logList($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
public function saveLog()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$params['submit_admin_id'] = $this->adminId;
|
||||
BeforehandOrderLogic::saveLog($params);
|
||||
return $this->success('保存成功');
|
||||
}
|
||||
|
||||
public function confirmLog()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$params['confirm_admin_id'] = $this->adminId;
|
||||
BeforehandOrderLogic::confirmLog($params);
|
||||
return $this->success('确认成功');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
||||
$oid=WarehouseOrder::where('financial_pm',0)->where('code','like','%'.$order_ck)->column('id');
|
||||
$this->searchWhere[] = ['outbound_id','in',$oid];
|
||||
}
|
||||
$file=['id','uid', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file','other_data'];
|
||||
$file=['id','uid', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file','other_data', 'audit_status'];
|
||||
return BeforehandOrder::where($this->searchWhere)
|
||||
->field($file)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
|
@ -9,6 +9,7 @@ use app\api\logic\order\OrderLogic;
|
||||
use app\common\model\beforehand_order\BeforehandOrder;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\beforehand_order\BeforehandOrderLog;
|
||||
use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo;
|
||||
use app\common\model\beforehand_order_record\BeforehandOrderRecord;
|
||||
use app\common\model\purchase_product_offer\PurchaseProductOffer;
|
||||
@ -909,4 +910,42 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
$file_path = $order_info->export($data, $order, $other_data, 2);
|
||||
return $file_path;
|
||||
}
|
||||
|
||||
public static function settleOrder($params)
|
||||
{
|
||||
$order = BeforehandOrder::where('id', $params['id'])->find();
|
||||
if ($order->status != 0) {
|
||||
throw new BusinessException('该订单已完结');
|
||||
}
|
||||
$order->audit_status = 1;
|
||||
$order->save();
|
||||
}
|
||||
|
||||
public static function logList($params)
|
||||
{
|
||||
$auditStatus = BeforehandOrder::where('id', $params['order_id'])->value('audit_status');
|
||||
$list = BeforehandOrderLog::with('admin')->where('order_id', $params['order_id'])->select()->toArray();
|
||||
return [
|
||||
'audit_status' => $auditStatus,
|
||||
'list' => $list,
|
||||
];
|
||||
}
|
||||
|
||||
public static function saveLog($params)
|
||||
{
|
||||
$model = new BeforehandOrderLog();
|
||||
$model->setAttrs($params);
|
||||
$model->save();
|
||||
}
|
||||
|
||||
public static function confirmLog($params)
|
||||
{
|
||||
$model = BeforehandOrderLog::where('id', $params['id'])->find();
|
||||
if ($model->status != 0) {
|
||||
throw new BusinessException('该审核已完成');
|
||||
}
|
||||
$model->status = 1;
|
||||
$model->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
29
app/common/model/beforehand_order/BeforehandOrderLog.php
Normal file
29
app/common/model/beforehand_order/BeforehandOrderLog.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\model\beforehand_order;
|
||||
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 预订单表模型
|
||||
* Class BeforehandOrderLog
|
||||
* @package app\common\model\beforehand_order
|
||||
*/
|
||||
class BeforehandOrderLog extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
protected $name = 'beforehand_order_log';
|
||||
protected $deleteTime = 'delete_time';
|
||||
protected $json = ['images'];
|
||||
protected $jsonAssoc = true;
|
||||
// 不生成该表的日志
|
||||
public $doNotRecordLog = true;
|
||||
|
||||
public function admin()
|
||||
{
|
||||
return $this->hasOne(Admin::class, 'id', 'admin_id')->field('id,name');
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user