| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 | <?phpnamespace app\api\controller\h5;use app\common\model\Banner;use app\common\model\Config;use app\common\model\Org;use app\hander\HelpHander;use think\Controller;use think\Db;use think\Exception;class Common extends Base {    public function banner() {        $ret = model('Banner')->getList(5, 1);        HelpHander::success($ret);    }    public function dep() {        $lists = Db::name('dep')            ->field('id,title')            ->where('org_id', $this->orgId)            ->where('enable', 1)            ->where('del', 0)            ->where('ph', 0)            ->select();        HelpHander::success($lists);    }    public function getOrg() {        $info = (new Org())->getInfo($this->orgId);        if (!$info) {            HelpHander::error('项目不存在');        }        HelpHander::success($info);    }    // 获取系统配置    public function getConfig() {        $name = input('name', '', 'trim');        $wyval = (new Config())->getConfig($name, $this->orgId);        HelpHander::success(['val' => $wyval]);    }    public function phprotocol() {        $id = input('orderId',0);        $str = '';        if ($id > 0){            $sign = Db::name('ph_orders')->where('id', $id)->value('sign');            $str = '            <p style="font-family:Calibri;margin-top: 50px">                <span style="font-family:宋体;font-size:28px;">客户签名:</span>            </p>            <p style="font-family:Calibri;">                <img height="150" width="130" src="' . $sign . '" alt="" />            </p>            <p style="font-family:Calibri;margin-top: 10px">                <span style="font-family:宋体;font-size:28px;">护工签名:</span>            </p>            <p style="font-family:Calibri;margin-bottom: 80px">            ';            $todos = Db::name('ph_todo')                ->where('order_id',$id)                ->whereIn('status',[1,2])                ->column('sign');            foreach ($todos as $k => $v){                if ($v){                    $str .= '                     <img height="130" width="120" src="' . $v . '" alt="" />                    ';                }            }            $str .= '</p>';        }        $info = Db::name("ph_protocol")->where('org_id',$this->orgId)->find();        if (!$info) {            HelpHander::success(['content'=>""]);        }        HelpHander::success(['content' => $info['content'].$str]);    }}
 |