aiyou 4 سال پیش
والد
کامیت
98e8b2d548

+ 311 - 0
application/admin/controller/cost/CostBillShouyin.php

@@ -0,0 +1,311 @@
+<?php
+
+namespace app\admin\controller\cost;
+
+use app\admin\model\cost\CostEdit;
+use app\admin\model\house\HuList;
+use app\common\controller\Backend;
+use think\Db;
+use think\exception\PDOException;
+use think\exception\ValidateException;
+
+/**
+ * 物业账单
+ *
+ * @icon fa fa-circle-o
+ */
+class CostBillShouyin extends Backend
+{
+    
+    /**
+     * CostBillShouyin模型对象
+     * @var \app\admin\model\cost\CostBillShouyin
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\cost\CostBillShouyin;
+
+    }
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+    /**
+     * 查看
+     */
+    public function index()
+    {
+
+
+        //  printer_open
+
+        //设置过滤方法
+        $this->request->filter(['strip_tags']);
+        if ($this->request->isAjax()) {
+            //如果发送的来源是Selectpage,则转发到Selectpage
+            if ($this->request->request('keyField')) {
+                return $this->selectpage();
+            }
+            $get=$this->request->get('filter');
+            $where_and=['is_delete'=>'0'];
+            $where_and['item_id']=['not in',['1','2']];
+            if (!empty($this->auth->village)){
+                $where_and['village_id']=['in',$this->auth->village];
+                //  dump($where_and);
+            }
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+
+            if (!empty($get)){
+                //   echo $get;exit;
+                $get=json_decode($get,true);
+
+
+                if (isset($get['village_id'])){
+                    $where_and['village_id']=['eq',$get['village_id']];
+                }
+                if (isset($get['hu.usesr_name'])){
+
+                    $get_huid=\app\admin\model\village\VillageHu::where('usesr_name','like','%'.$get['hu.usesr_name'].'%')->field('id')->select();
+                    $hu_id=array_column($get_huid,'id');
+                    $where_and['hu_id']=['in',$hu_id];
+                }
+                $total = $this->model
+                    ->where($where_and)
+                    ->order($sort, $order)
+                    ->count();
+
+                $list = $this->model
+
+                    ->where($where_and)
+                    ->with(['village','dong','danyuan','hu','item'])
+                    ->order($sort, $order)
+                    ->limit($offset, $limit)
+                    ->select();
+
+
+            }else{
+
+
+
+
+                $total = $this->model
+                    ->where($where)
+                    ->where($where_and)
+                    ->order($sort, $order)
+                    ->count();
+
+                $list = $this->model
+                    ->where($where)
+                    ->where($where_and)
+                    ->with(['village','dong','danyuan','hu','item'])
+                    ->order($sort, $order)
+                    ->limit($offset, $limit)
+                    ->select();
+            }
+
+
+            $list = collection($list)->toArray();
+            $result = array("total" => $total, "rows" => $list);
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+
+    /**
+     * 编辑
+     */
+    public function edit($ids = null)
+    {
+        $row = $this->model->get($ids,['village','dong','danyuan','hu','item']);
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        $adminIds = $this->getDataLimitAdminIds();
+        if (is_array($adminIds)) {
+            if (!in_array($row[$this->dataLimitField], $adminIds)) {
+                $this->error(__('You have no permission'));
+            }
+        }
+        if ($this->request->isPost()) {
+            $params = $this->request->post("row/a");
+            if ($params) {
+                $params = $this->preExcludeFields($params);
+
+
+
+                $result = false;
+                Db::startTrans();
+                try {
+                    //是否采用模型验证
+                    if ($this->modelValidate) {
+                        $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+                        $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
+                        $row->validateFailException(true)->validate($validate);
+                    }
+
+                    if ($row['pay_status']=='0'){//未付款的情况
+                        if ($params['true_price'] !=$row['true_price']){//修改价格
+                            if ($params['pay_status']=='1'){
+                                $this->error(__('您好,修改物业费,需要上级同意之后方可付款', ''));
+                            }else{
+                                $insert['true_price_old']=$row['true_price'];
+                                $insert['true_price_new']=$params['true_price'];
+                                $insert['property_id']=$this->auth->property_id;
+                                $insert['bill_id']=$row['id'];
+                                $insert['status']='1';
+                                $insert['mark']=$params['mark'];
+                                $insert['createtime']=$insert['updatetime']=time();
+                                CostEdit::insert($insert);
+                                $params['true_price'] = $row['true_price'];
+                            }
+                        }elseif ($params['pay_status'] !=$row['pay_status']){//修改成已付款
+                            if ($params['pay_status']=='1'){
+                                $params['pay_time']=time();
+                                $order_number=time().rand('1000','9999');
+                                $params['order_number']=$order_number;
+                                HuList::where('id',$row['hu_id'])->update(['last_date'=>date('Y-m-d')]);
+                            }
+                        }
+                    }else{
+                        if ($params['true_price'] !=$row['true_price'] || $params['pay_status'] != $row['pay_status']){
+                            $this->error(__('您好,已付款的账单,不可以修改', ''));
+                        }
+                    }
+
+                    $result = $row->allowField(true)->save($params);
+                    Db::commit();
+                } catch (ValidateException $e) {
+                    Db::rollback();
+                    $this->error($e->getMessage());
+                } catch (PDOException $e) {
+                    Db::rollback();
+                    $this->error($e->getMessage());
+                } catch (Exception $e) {
+                    Db::rollback();
+                    $this->error($e->getMessage());
+                }
+                if ($result !== false) {
+                    $this->success();
+                } else {
+                    $this->error(__('No rows were updated'));
+                }
+            }
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        if ($row['item_id']=='1'){
+            $row['item_name']='水费';
+        }elseif($row['item_id']=='2'){
+            $row['item_name']='电费';
+        }else{
+            //  $get_itme=CostItem::where('id',$row['item_id'])->field('item')->find();
+            if ($row['item']['item']=='1'){
+                $row['item_name']='物业费';
+            }elseif ($row['item']['item']=='2'){
+                $row['item_name']='垃圾处理费';
+            }elseif ($row['item']['item']=='3'){
+                $row['item_name']='车位费';
+            }else{
+                $row['item_name']='未知';
+            }
+        }
+        $row['house']=$row['village']['name']." ".$row['dong']['name']." ".$row['danyuan']['name']." ".$row['hu']['name'];
+//        $get_edit=CostEdit::where('bill_id',$row['id'])->where('is_delete','0')->select();
+//        $this->view->assign("get_edit", $get_edit);
+
+
+
+        $this->view->assign("row", $row);
+        return $this->view->fetch();
+    }
+    /**
+     * 删除
+     */
+    public function del($ids = "")
+    {
+        if ($ids) {
+            $pk = $this->model->getPk();
+            $adminIds = $this->getDataLimitAdminIds();
+            if (is_array($adminIds)) {
+                $this->model->where($this->dataLimitField, 'in', $adminIds);
+            }
+            $list = $this->model->where($pk, 'in', $ids)->select();
+
+            $count = 0;
+            Db::startTrans();
+            try {
+                foreach ($list as $k => $v) {
+                    $count += $v->save(['is_delete'=>1]);
+                }
+                Db::commit();
+            } catch (PDOException $e) {
+                Db::rollback();
+                $this->error($e->getMessage());
+            } catch (Exception $e) {
+                Db::rollback();
+                $this->error($e->getMessage());
+            }
+            if ($count) {
+                $this->success();
+            } else {
+                $this->error(__('No rows were deleted'));
+            }
+        }
+        $this->error(__('Parameter %s can not be empty', 'ids'));
+    }
+
+    /**
+     * 批量更新
+     */
+    public function multi($ids = "")
+    {
+        $ids = $ids ? $ids : $this->request->param("ids");
+        if ($ids) {
+            if ($this->request->has('params')) {
+                parse_str($this->request->post("params"), $values);
+
+                $values = $this->auth->isSuperAdmin() ? $values : array_intersect_key($values, array_flip(is_array($this->multiFields) ? $this->multiFields : explode(',', $this->multiFields)));
+                if ($values) {
+                    $adminIds = $this->getDataLimitAdminIds();
+                    if (is_array($adminIds)) {
+                        $this->model->where($this->dataLimitField, 'in', $adminIds);
+                    }
+                    $count = 0;
+                    Db::startTrans();
+                    try {
+                        $list = $this->model->where($this->model->getPk(), 'in', $ids)->select();
+                        foreach ($list as $index => $item) {
+                            if ($values['pay_status']=='1'){
+                                $values['pay_time']=time();
+                            }else{
+                                $values['pay_time']='';
+                            }
+
+                            $count += $item->allowField(true)->isUpdate(true)->save($values);
+                        }
+                        Db::commit();
+                    } catch (PDOException $e) {
+                        Db::rollback();
+                        $this->error($e->getMessage());
+                    } catch (Exception $e) {
+                        Db::rollback();
+                        $this->error($e->getMessage());
+                    }
+                    if ($count) {
+                        $this->success();
+                    } else {
+                        $this->error(__('No rows were updated'));
+                    }
+                } else {
+                    $this->error(__('You have no permission'));
+                }
+            }
+        }
+        $this->error(__('Parameter %s can not be empty', 'ids'));
+    }
+}

+ 27 - 0
application/admin/lang/zh-cn/cost/cost_bill_shouyin.php

@@ -0,0 +1,27 @@
+<?php
+
+return [
+    'Id'           => 'ID',
+    'Order_number' => '编号',
+    'Item_id'      => '所属收费项目',
+    'Property_id'  => '所属物业',
+    'Village_id'   => '所属小区',
+    'Dong_id'      => '所属哪一栋楼',
+    'Danyuan_id'   => '所属哪个单元',
+    'Hu_id'        => '所属哪一户',
+    'Mid'          => '用户id',
+    'Price'        => '价格',
+    'True_price'   => '实付金额',
+    'Yongliang'    => '用量',
+    'Danwei'       => '单位',
+    'Danjia'       => '单价',
+    'Start_time'   => '账单开始时间',
+    'End_time'     => '账单结束时间',
+    'Pay_time'     => '缴费日期',
+    'Pay_status'   => '0未付款1已付款',
+    'Createtime'   => '创建时间',
+    'Updatetime'   => '更新时间',
+    'Status'       => '状态',
+    'Is_delete'    => '是否删除',
+    'Mark'         => '备注'
+];

+ 98 - 0
application/admin/model/cost/CostBillShouyin.php

@@ -0,0 +1,98 @@
+<?php
+
+namespace app\admin\model\cost;
+
+use think\Model;
+
+
+class CostBillShouyin extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'cost_bill';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'int';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+    protected $deleteTime = false;
+
+
+    // 追加属性
+    protected $append = [
+        'start_time_text',
+        'end_time_text',
+        'pay_time_text'
+    ];
+
+
+
+
+
+
+    public function getStartTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
+
+        return is_numeric($value) ? date("Y-m", $value) : $value;
+    }
+
+
+    public function getEndTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
+        return is_numeric($value) ? date("Y-m", $value) : $value;
+    }
+
+
+
+    public function getPayTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['pay_time']) ? $data['pay_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+    protected function setStartTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setEndTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setPayTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+    public function village(){
+        return $this->belongsTo('app\admin\model\village\Village','village_id','id')->field('id,v_name as name,property_id');
+    }
+
+    public function dong(){
+        return $this->belongsTo('app\admin\model\village\VillageDong','dong_id','id')->field('id,d_name as name');
+    }
+
+    public function danyuan(){
+        return $this->belongsTo('app\admin\model\village\VillageDanyuan','danyuan_id','id')->field('id,dy_name as name');
+    }
+
+    public function hu(){
+        return $this->belongsTo('app\admin\model\village\VillageHu','hu_id','id')->field('id,hu_name as name,usesr_name');
+    }
+
+    public function member(){
+        return $this->belongsTo('app\admin\model\Member','mid','id')->field('id,avatar,nickname');
+    }
+    public function item(){
+        return $this->belongsTo('app\admin\model\cost\CostItem','item_id','id')->field('id,item');
+    }
+
+}

+ 27 - 0
application/admin/validate/cost/CostBillShouyin.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate\cost;
+
+use think\Validate;
+
+class CostBillShouyin extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 130 - 0
application/admin/view/cost/cost_bill_shouyin/add.html

@@ -0,0 +1,130 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Order_number')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-order_number" data-rule="required" class="form-control" name="row[order_number]" type="text" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Item_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-item_id" data-rule="required" data-source="item/index" class="form-control selectpage" name="row[item_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Property_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-property_id" data-rule="required" data-source="property/index" class="form-control selectpage" name="row[property_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Village_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-village_id" data-rule="required" data-source="village/index" class="form-control selectpage" name="row[village_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Dong_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-dong_id" data-rule="required" data-source="dong/index" class="form-control selectpage" name="row[dong_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Danyuan_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-danyuan_id" data-rule="required" data-source="danyuan/index" class="form-control selectpage" name="row[danyuan_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Hu_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-hu_id" data-rule="required" data-source="hu/index" class="form-control selectpage" name="row[hu_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mid')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mid" data-rule="required" class="form-control" name="row[mid]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="0.00">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('True_price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-true_price" data-rule="required" class="form-control" step="0.01" name="row[true_price]" type="number" value="0.00">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Yongliang')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-yongliang" data-rule="required" class="form-control" name="row[yongliang]" type="text" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Danwei')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-danwei" data-rule="required" class="form-control" name="row[danwei]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Danjia')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-danjia" data-rule="required" class="form-control" step="0.01" name="row[danjia]" type="number" value="0.00">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-start_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[pay_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_status" class="form-control" name="row[pay_status]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="1">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_delete')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-is_delete" data-rule="required" class="form-control" name="row[is_delete]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mark')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mark" data-rule="required" class="form-control" name="row[mark]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 71 - 0
application/admin/view/cost/cost_bill_shouyin/edit.html

@@ -0,0 +1,71 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Item_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input class="form-control "  type="text"  disabled="disabled" value="{$row.item_name|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('房产')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input   data-rule="required"  class="form-control" disabled="disabled" type="text" value="{$row.house|htmlentities}">
+        </div>
+    </div>
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input disabled="disabled"  class="form-control" step="0.01"  type="number" value="{$row.price|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('True_price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-true_price" data-rule="required" class="form-control" step="0.01" name="row[true_price]" type="number" value="{$row.true_price|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input  class="form-control datetimepicker" disabled="disabled"   data-date-format="YYYY-MM-DD" data-use-current="true"  type="text" value="{:$row.start_time?datetime($row.start_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" disabled="disabled"  type="text" value="{:$row.end_time?datetime($row.end_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('支付状态')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="col-xs-12 col-sm-8">
+                {:build_radios('row[pay_status]', ['0'=>__('未付款'),'1'=>__('已付款')],$row['pay_status'])}
+            </div>
+            <!--           // <input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="{$row.status|htmlentities}">-->
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[pay_time]" type="text" value="{:$row.pay_time?datetime($row.pay_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mark" class="form-control" name="row[mark]" type="text" value="{$row.mark|htmlentities}">
+        </div>
+    </div>
+
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>
+
+

+ 35 - 0
application/admin/view/cost/cost_bill_shouyin/index.html

@@ -0,0 +1,35 @@
+<div class="panel panel-default panel-intro">
+    {:build_heading()}
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <!--                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('cost/cost_bill_auto/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
+                        <!--                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('cost/cost_bill_auto/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
+                        <!--                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('cost/cost_bill_auto/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
+<!--                        <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('cost/cost_bill_auto/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
+
+                        <!--                        <div class="dropdown btn-group {:$auth->check('cost/cost_bill_auto/multi')?'':'hide'}">-->
+                        <!--                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
+                        <!--                            <ul class="dropdown-menu text-left" role="menu">-->
+                        <!--                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->
+                        <!--                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->
+                        <!--                            </ul>-->
+                        <!--                        </div>-->
+
+
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('cost/cost_bill_auto/edit')}"
+                           data-operate-del="{:$auth->check('cost/cost_bill_auto/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 1 - 1
application/api/controller/Member.php

@@ -485,7 +485,7 @@ class Member extends Api
         }
 
         $appid = 'wxdbf57a855b519ecf';
-        $appsecret = '46a02319143e8c2f9b1d96104bd467e7';
+        $appsecret = '87dc4671be6b63697a0048767924e94d';
 
 
         $access_token_url = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=' . $appid . '&secret=' . $appsecret . '&code=' . $code . '&grant_type=authorization_code';

+ 85 - 0
public/assets/js/backend/cost/cost_bill_shouyin.js

@@ -0,0 +1,85 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'cost/cost_bill_shouyin/index' + location.search,
+                    add_url: 'cost/cost_bill_shouyin/add',
+                    edit_url: 'cost/cost_bill_shouyin/edit',
+                    del_url: 'cost/cost_bill_shouyin/del',
+                    multi_url: 'cost/cost_bill_shouyin/multi',
+                    table: 'cost_bill',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'id',
+
+                search:false,
+                showToggle: false,
+                showColumns: false,
+                visible: false,
+                showExport: false,
+                //commonSearch: false,
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id'),operate:false},
+                        //  {field: 'item_id', title: __('Item_id')},
+                        {field: 'item.item', title: __('收费项目'), searchList: {"1":__('物业费'),"2":__('垃圾处理费'),"3":__('车位费')}, formatter: Table.api.formatter.normal,operate:false},
+                        // {field: 'property_id', title: __('Property_id')},
+
+
+                        {field: 'village_id', title: __('Village_id'), searchList: $.getJSON("ajax/village_select"),
+                            formatter: function (value, row, index) {
+                                return row.village.name;
+                            }
+                        },
+
+
+                        //{field: 'dong.name', title: __('楼宇')},
+
+                        {field: 'dong.name', title: __('楼宇'),operate:false},
+
+
+                        {field: 'danyuan.name', title: __('单元'),operate:false},
+                        {field: 'hu.name', title: __('房产'),operate:false},
+                        {field: 'hu.usesr_name', title: __('业主'),operate:'LIKE'},
+                        // {field: 'mid', title: __('Mid')},
+                        {field: 'price', title: __('Price'), operate:false},
+                        {field: 'true_price', title: __('True_price'), operate:false},
+                        {field: 'start_time_text', title: __('账单周期'), operate:false,formatter:function(value,row){return row.start_time_text + "~" + row.end_time_text; }},
+                        {field: 'pay_time', title: __('Pay_time'), operate:false, addclass:'datetimerange', formatter: Table.api.formatter.datetime},
+                        // {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
+                        // {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
+                        {field: 'pay_status', title: __('缴费状态'), formatter:Table.api.formatter.toggle},
+                        // {field: 'is_delete', title: __('Is_delete')},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});