Commit eea7f74d authored by zhuwei's avatar zhuwei

收款列表-收款图片列表

parent de216fd3
...@@ -161,6 +161,47 @@ class Collection extends Basic ...@@ -161,6 +161,47 @@ class Collection extends Basic
} }
/**
* 收款列表-收款图片列表
* 朱伟 2018-07-04
*/
public function receiptImgList(){
$params = $this->params;
$params = array(
"id" => 6,
);
if(!isset($params["id"])){
return $this->response("101","请求参数错误");
}
$params['id'] = $params["id"];
$field = 'id,father_id';
//先查询收款表
$order = new OPayLogModel();
$order_res = $order->selectReceiptImgList($field , $params);
//判断收款表数据father_id是否大于o,如果大于0图片需要按img_id=father_id查询
if(!empty($order_res[0]['father_id']) && ($order_res[0]['father_id'] > 0)){
$params_img['img_id'] = $order_res[0]['father_id'];
}else{
$params_img['img_id'] = $params['id'];
}
$field = 'id,img_name';
$order = new OImg();
$res = $order->getImgList($params_img,$field);
foreach ($res as $k => $v) {
$res[$k]['img_name'] = CHAT_IMG_URL . $v['img_name'];
}
if($res){
return $this->response("200","成功",$res);
}else{
return $this->response("200","成功",$res);
}
}
/** /**
* 收款列表记录上传图片 * 收款列表记录上传图片
* 朱伟 2018-07-04 * 朱伟 2018-07-04
......
...@@ -114,10 +114,13 @@ class OImg extends BaseModel ...@@ -114,10 +114,13 @@ class OImg extends BaseModel
} }
$where_["img_status"] = 0; $where_["img_status"] = 0;
return $this $res = $this
->field($field) ->field($field)
->where($where_) ->where($where_)
->select(); ->select();
//var_dump($this->getLastSql());
return $res;
} }
/** /**
......
...@@ -74,6 +74,9 @@ class OPayLogModel extends Model ...@@ -74,6 +74,9 @@ class OPayLogModel extends Model
public function selectPayLogByOrderNo($filed , $params) public function selectPayLogByOrderNo($filed , $params)
{ {
$where_ = []; $where_ = [];
if (isset($params["id"])) {
$where_["id"] = $params["id"];
}
if (isset($params["report_id"])) { if (isset($params["report_id"])) {
$where_["report_id"] = $params["report_id"]; $where_["report_id"] = $params["report_id"];
} }
...@@ -330,4 +333,21 @@ class OPayLogModel extends Model ...@@ -330,4 +333,21 @@ class OPayLogModel extends Model
public function getMoneyTotal() { public function getMoneyTotal() {
return $this->sum('money'); return $this->sum('money');
} }
/**
* 收款列表-查询收款数据
* 朱伟 2018-07-04
*/
public function selectReceiptImgList($filed , $params)
{
$where_ = [];
if (isset($params["id"])) {
$where_["id"] = $params["id"];
}
return Db::table($this->table)
->field($filed)
->where($where_)
->select();
}
} }
\ No newline at end of file
...@@ -234,6 +234,7 @@ Route::group('index', [ ...@@ -234,6 +234,7 @@ Route::group('index', [
'checkOver' => [ 'index/Finance/checkOver', [ 'method' => 'POST' ] ], //财务结单 'checkOver' => [ 'index/Finance/checkOver', [ 'method' => 'POST' ] ], //财务结单
'addReceiptImg' => [ 'index/Collection/addReceiptImg', [ 'method' => 'post|get' ] ],//收款图片信息保存 'addReceiptImg' => [ 'index/Collection/addReceiptImg', [ 'method' => 'post|get' ] ],//收款图片信息保存
'deleteReceiptImg' => [ 'index/Collection/deleteReceiptImg', [ 'method' => 'post|get' ] ],//删除收款图片 'deleteReceiptImg' => [ 'index/Collection/deleteReceiptImg', [ 'method' => 'post|get' ] ],//删除收款图片
'receiptImgList' => [ 'index/Collection/receiptImgList', [ 'method' => 'post|get' ] ],//收款列表-收款图片列表
......
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