<?php
    namespace app\money\model;
    use think\helper\Hash;
    use app\money\model\Role as RoleModel;
    use think\model;
    use think\Db;
    
    class EsopPlanRecord extends Model
    {
        
        // 设置当前模型对应的完整数据表名称
        protected $table = '__ESOP__PLAN__Record__';


        public static function  getAll($map=[], $order='')
        {
            $data_list = self::view('esop_plan_record pr', true)
                        ->view('member', 'mobile, name, id_card', 'member.id=pr.mid', 'left')
                        ->view('stock_list', 'title', 'stock_list.id=pr.stock_id', 'left')
                        ->where($map)
                        ->order($order)
                        ->paginate()
                        ->each( function($item, $key){
                            $item->affect = money_convert($item->affect);
                            $item->surplus = money_convert($item->surplus);
                        });
       
            return $data_list;

        }
    }
?>
