Commit ed692314 authored by clone's avatar clone

bug

parent 02b281a4
......@@ -332,9 +332,9 @@ class OrderLog extends Basic
public function selectReportAll()
{
$params = $this->params;
/* $params = array(
"order_id" => 2,
);*/
$params = array(
"order_id" => 38024,
);
if (!isset($params["order_id"])) {
return $this->response("101", "请求参数错误");
}
......
......@@ -79,7 +79,7 @@ class OrderLogService
if ($father_id > 0) {
//保存图片
$oImgModel = new OImg();
$oImgModel->addImgAll($father_id,2,$transfer_img);
$oImgModel->addImgAll($father_id, 2, $transfer_img);
$pushMarchIn = new PushMessageService($params["report_id"], 2);
$pushMarchIn->pushMarchInMessage($params["report_id"], 2); //推送
......@@ -283,12 +283,12 @@ class OrderLogService
}
//收款
$field_pay_log = "id,order_no,order_id,agent_id,agent_name,type,pay_type,money,house_number,industry_type,
$field_pay_log = "id,order_no,father_id,order_id,agent_id,agent_name,type,pay_type,money,house_number,industry_type,
remark,transfer_img,real_money,source,create_time";
$payLogData = $oPayLogModel->selectPayLogByOrderNo($field_pay_log, [ "order_id" => $order_id ]);
if (count($payLogData) > 0) {
foreach ($payLogData as $k => $v) {
$sortPayLogData = $this->arr2tree($payLogData);
foreach ($sortPayLogData as $k => $v) {
$v["step_name"] = "pay_log";
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
......@@ -321,6 +321,32 @@ class OrderLogService
return $this->sortByTime($result);
}
public function arr2tree($list)
{
$tree = $trees = [];
foreach ($list as $key => $item) {
if ($item["father_id"] == 0) {
$list[$key]["father_id"] = $item["id"];
}
}
foreach ($list as $value) {
$tree[$value["father_id"]][] = $value;
}
foreach ($tree as $i => $v) {
//查询图片
$oImgModel = new OImg();
$params["img_id"] = $v[0]["father_id"];
$params["img_type"] = 2;
$img_arr = $oImgModel->getImgList($params);
$trees[$i]["img"] = $img_arr;
$trees[$i]["list"] = $v;
}
sort($trees);
return $trees;
}
/**
* 查询流程 客户动态
......
......@@ -104,7 +104,7 @@ class OImg extends BaseModel
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
*/
public function getImgList(array $params, string $field = "id")
public function getImgList(array $params, string $field = "id,img_name")
{
if (isset($params["img_id"])) {
$where_["img_id"] = $params["img_id"];
......@@ -114,13 +114,12 @@ class OImg extends BaseModel
}
$where_["img_status"] = 0;
$res = $this
$data = $this->db_
->field($field)
->where($where_)
->select();
//var_dump($this->getLastSql());
return $res;
// echo $this->getLastSql();
return $data;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment