Commit a019056b authored by hujun's avatar hujun

Merge branch '0731-v3.3.6' of gitee.com:zwyjjc/tl_estate into 0731-v3.3.6

parents 2f36640e 5f14fb00
......@@ -178,4 +178,7 @@ class DailyPaper extends Basic
return $this->response("200", "request null");
}
}
}
\ No newline at end of file
<?php
namespace app\index\controller;
use app\api\service\AccountBalanceService;
use app\api_broker\service\RedisCacheService;
use app\index\extend\Basic;
use app\model\GReceiptOperatingRecords;
use app\model\ODailyUncommittedModel;
use think\Request;
class DailyUncommitted extends Basic
{
private $m_daily_uncommitted;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->m_daily_uncommitted = new ODailyUncommittedModel();
}
/**
* 新增记录
* @param $agents_id
* @param $type
* @param $pay_log_id
* @return bool
*/
public function addOperating($agents_id,$type,$pay_log_id)
{
// $data["agents_id"] = $agents_id;
// $data["type"] = $type;
// $data["remark"] = $type == 1 ? "删除收款ID:{$pay_log_id}" : "撤销调整收款ID:{$pay_log_id}";
// $data["pay_log_id"] = $pay_log_id;
//
// $result = $this->m_receipt_operating_records->saveOperating($data);//int(1)
//
// if ($result) {
// return true;
// } else {
// return false;
// }
}
/**
* 财务日报未提交 记录
* @return \think\Response
*/
public function DailyUncommittedList()
{
$params = $this->params;
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$conditions = [];
if (!empty($params['daily_date']) ) {
if(!checkTimeData($params['daily_date'])){
return $this->response("101", '非法时间');
}
$conditions['a.daily_date'] = $params['daily_date'];
}
if (!empty($params['store_id'])) {
$conditions['a.store_id'] = $params['store_id'];
}
$conditions['a.status'] = 1;
$field = 'a.daily_date,b.store_name';
$result = $this->m_daily_uncommitted->getDailyUncommittedList($field, $conditions, $pageNo, $pageSize);
if (!$result)
return $this->response("200", "成功", []);
$result_total = $this->m_daily_uncommitted->getDailyUncommittedTotal($field, $conditions);
$data['list'] = $result;
$data['total'] = $result_total;
return $this->response("200", "成功", $data);
}
}
\ No newline at end of file
<?php
namespace app\model;
use think\Db;
use think\Model;
class ODailyUncommittedModel extends Model
{
// 设置当前模型对应的完整数据表名称
protected $table = 'o_daily_uncommitted';
private $db_;
public function __construct($data = [])
{
parent::__construct($data);
$this->db_ = Db::name($this->table);
}
public function saveDailyUncommitted($data) {
$time = date("Y-m-d H:i:s", time());
$data['a.create_time'] = $time;
$data['a.update_time'] = $time;
$data['a.is_del'] = 0;
return $this->db_ ->insert($data);
}
/**
* 查询数据
*/
public function getDailyUncommitted($field,$params)
{
$params["a.is_del"] = 0;
$result = $this->db_
->field($field)
->alias('a')
->where($params)
->find();
//echo $this->getLastSql();
return $result;
}
/**
* 财务日报未提交 记录
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @return false|\PDOStatement|string|\think\Collection
*/
public function getDailyUncommittedList($field,$params,$pageNo, $pageSize)
{
$result = $this->db_
->field($field)
->alias("a")
->join("a_store b","a.store_id=b.id","left")
->where($params)
->limit($pageSize)
->page($pageNo)
->order('a.id desc')
->select();
return $result;
}
/**
* 财务日报未提交 记录
* @param $field
* @param $params
* @return int|string
*/
public function getDailyUncommittedTotal($field,$params)
{
$result = $this->db_
->field($field)
->alias("a")
->join("a_store b","a.store_id=b.id","left")
->where($params)
->count();
return $result;
}
}
......@@ -569,6 +569,8 @@ Route::group('index', [
'receiptOperatingRecordsList' => ['index/ReceiptOperatingRecords/receiptOperatingRecordsList', ['method' => 'POST|GET']],
'DailyUncommittedList' => ['index/DailyUncommitted/DailyUncommittedList', ['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