Commit f3633f8d authored by hujun's avatar hujun

财务日报列表

parent 893d9c1b
......@@ -20,6 +20,7 @@ use app\model\GHouses;
use app\model\GHousesToAgents;
use app\model\OBargainLogModel;
use app\model\OBargainModel;
use app\model\ODaily;
use app\model\OImg;
use app\model\OMarchInModel;
use app\model\OPayLogAdjustment;
......@@ -3055,8 +3056,76 @@ class Finance extends Basic
return $this->response($code, $msg, $data);
}
/**
* 财务日报
*
* @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function dailyList() {
return view('daily_list');
if (!$this->request->isAjax()) {
// return view('daily_list');
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$where['is_del'] = 0;
if (!empty($this->params['id'])) {
$where['id'] = $this->params['id'];
}
if (!empty($this->params['start_time']) && empty($this->params['end_time'])) {
$where['create_time'] = [ '> time', $this->params['start_time'] . ' 00:00:00' ];
}
if (!empty($this->params['end_time']) && empty($this->params['start_time'])) {
$where['create_time'] = [ '< time', $this->params['end_time'] . ' 23:59:59' ];
}
if (!empty($this->params['end_time']) && !empty($this->params['start_time'])) {
$where['create_time'] = [ 'between time', [ $this->params['start_time'] . ' 00:00:00', $this->params['end_time'] . ' 23:59:59' ] ];
}
if (!empty($this->params['daily_start_time']) && empty($this->params['daily_end_time'])) {
$where['daily_date'] = [ '> time', $this->params['daily_start_time']];
}
if (!empty($this->params['daily_end_time']) && empty($this->params['daily_start_time'])) {
$where['daily_date'] = [ '< time', $this->params['daily_end_time']];
}
if (!empty($this->params['daily_end_time']) && !empty($this->params['daily_start_time'])) {
$where['daily_date'] = [ 'between time', [ $this->params['start_time'], $this->params['daily_end_time']] ];
}
if (!empty($this->params['store_id'])) {
$where['store_id'] = $this->params['store_id'];
}
if (!empty($this->params['district_id'])) {
$where['district_id'] = $this->params['district_id'];
}
if (!empty($this->params['agent_id'])) {
$where['agent_id'] = $this->params['agent_id'];
}
$m_daily = new ODaily();
$m_store = new AStore();
$field = 'id,agent_id,create_time,daily_date,store_id,status';
$list = $m_daily->getList($pageNo, $pageSize, 'id desc', $field, $where);
foreach ($list as $k=>$v) {
$store_name = $m_store->getStoreKeyById('store_name', ['id'=>$v['store_id']]);
$list[$k]['store_name'] = empty($store_name) ? '':$store_name;
}
$data['list'] = $list;
$data['total'] = $m_daily->getTotal($where);
return $this->response(200, '', $data);
}
public function dailyDetails() {
......
......@@ -11,13 +11,14 @@ use think\Model;
* Time : 11:26 AM
* Intro:
*/
class ODaily extends Model{
class ODaily extends BaseModel{
protected $table = "o_daily";
private $db_;
public function __construct()
public function __construct($data = [])
{
parent::__construct($data);
$this->db_ = Db::name($this->table);
}
......
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